Skip to contentSkip to conversation

b43: N-PHY: add overriding RF control for rev7+

DISCUSSION Dan Carpenter 2 participants 2 messages Aug 9, 2012 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 21 lines · Dan Carpenter

Hello Rafa? Mi?ecki,

This is a semi-automatic email about new static checker warnings.

The patch c071b9f666be: "b43: N-PHY: add overriding RF control for rev7+" from Jul 26, 2012, leads to the following Smatch complaint:

drivers/net/wireless/b43/phy_n.c:158 b43_nphy_rf_control_override_rev7()
warn: variable dereferenced before check 'e' (see line 154)

drivers/net/wireless/b43/phy_n.c
153

   154			val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

New dereferences.

   155	
   156			if (off) {
   157				b43_phy_mask(dev, en_addr, ~en_mask);
   158				if (e) /* Do it safer, better than wl */
                                   ^^^
Quoted 5 lines

New check.

   159					b43_phy_mask(dev, val_addr, ~e->val_mask);
   160			} else {

There is a second NULL check a couple lines down as well.

regards,
dan carpenter

#2 lore raw

2012/8/9 Dan Carpenter <[email protected]>:

Quoted 24 lines · Dan Carpenter
Quoted 23 lines

Hello Rafa? Mi?ecki,

This is a semi-automatic email about new static checker warnings.

The patch c071b9f666be: "b43: N-PHY: add overriding RF control for rev7+" from Jul 26, 2012, leads to the following Smatch complaint:

drivers/net/wireless/b43/phy_n.c:158 b43_nphy_rf_control_override_rev7()
warn: variable dereferenced before check 'e' (see line 154)

drivers/net/wireless/b43/phy_n.c
153

   154                        val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

New dereferences.

   155
   156                        if (off) {
   157                                b43_phy_mask(dev, en_addr, ~en_mask);
   158                                if (e) /* Do it safer, better than wl */
                                   ^^^

New check.

Quoted 5 lines
Quoted 3 lines
   159                                        b43_phy_mask(dev, val_addr, ~e->val_mask);
   160                        } else {

There is a second NULL check a couple lines down as well.

I failed at that, thanks!

Signature · 1 line
Rafa?