diff options
| author | Robertus Diawan Chris <robertusdchris@gmail.com> | 2026-06-02 12:41:33 +0700 |
|---|---|---|
| committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2026-06-19 22:55:16 +0200 |
| commit | 649147cb3f8b3c0c9aeba5d89d69a6ef221c12c2 (patch) | |
| tree | 16f69b6d82003752e251e3f64a856677067d267b /net/mac802154/scan.c | |
| parent | 4db86f8ab11b5a41bfc36680be837e6ac1375ec6 (diff) | |
| download | linux-next-649147cb3f8b3c0c9aeba5d89d69a6ef221c12c2.tar.gz linux-next-649147cb3f8b3c0c9aeba5d89d69a6ef221c12c2.zip | |
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>
Diffstat (limited to 'net/mac802154/scan.c')
| -rw-r--r-- | net/mac802154/scan.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mac802154/scan.c b/net/mac802154/scan.c index 0a31ac8d8415..300d4584533e 100644 --- a/net/mac802154/scan.c +++ b/net/mac802154/scan.c @@ -594,6 +594,7 @@ int mac802154_perform_association(struct ieee802154_sub_if_data *sdata, "Negative ASSOC RESP received from %8phC: %s\n", &ceaddr, local->assoc_status == IEEE802154_PAN_AT_CAPACITY ? "PAN at capacity" : "access denied"); + goto clear_assoc; } ret = 0; |
