Skip to content

Commit

Permalink
net/wireless: Delete unnecessary checks before the macro call “dev_kf…
Browse files Browse the repository at this point in the history
…ree_skb”

The dev_kfree_skb() function performs also input parameter validation.
Thus the test around the shown calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
  • Loading branch information
elfring authored and nbd168 committed Dec 22, 2019
1 parent 99d8cd0 commit 32129af
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mt76x02_beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ int mt76x02_mac_set_beacon(struct mt76x02_dev *dev, u8 vif_idx,
for (i = 0; i < ARRAY_SIZE(dev->beacons); i++) {
if (vif_idx == i) {
force_update = !!dev->beacons[i] ^ !!skb;

if (dev->beacons[i])
dev_kfree_skb(dev->beacons[i]);

dev_kfree_skb(dev->beacons[i]);
dev->beacons[i] = skb;
__mt76x02_mac_set_beacon(dev, bcn_idx, skb);
} else if (force_update && dev->beacons[i]) {
Expand Down

0 comments on commit 32129af

Please sign in to comment.