]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mac802154: Prevent overwrite return code in mac802154_perform_association()
authorRobertus Diawan Chris <robertusdchris@gmail.com>
Tue, 2 Jun 2026 05:41:33 +0000 (12:41 +0700)
committerStefan Schmidt <stefan@datenfreihafen.org>
Fri, 19 Jun 2026 20:55:16 +0000 (22:55 +0200)
commit649147cb3f8b3c0c9aeba5d89d69a6ef221c12c2
tree16f69b6d82003752e251e3f64a856677067d267b
parent4db86f8ab11b5a41bfc36680be837e6ac1375ec6
mac802154: Prevent overwrite return code in mac802154_perform_association()

When assoc_status not equal to IEEE802154_ASSOCIATION_SUCCESSFUL, the
return value assigned to either "-ERANGE" or "-EPERM" but this return
value will be overwritten to 0 after exiting the conditional scope.
So, jump to clear_assoc label to preserve the return value when
assoc_status not equal to IEEE802154_ASSOCIATION_SUCCESSFUL.

This is reported by Coverity Scan as "Unused value".

Fixes: fefd19807fe9 ("mac802154: Handle associating")
Signed-off-by: Robertus Diawan Chris <robertusdchris@gmail.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/20260602054133.470293-1-robertusdchris@gmail.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
net/mac802154/scan.c