diff options
author | xypron.glpk@gmx.de <xypron.glpk@gmx.de> | 2016-05-18 00:06:02 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-05-19 11:30:57 -0700 |
commit | 30119059703f94e9e4936477bc33e918fb41e9c8 (patch) | |
tree | be374b5d2e3d4bed1887f0241c683c3bca10dd44 /drivers/net/irda/nsc-ircc.c | |
parent | d113412859e49620ce8fe67d5ff9f34fe5006f99 (diff) | |
download | blackbird-op-linux-30119059703f94e9e4936477bc33e918fb41e9c8.tar.gz blackbird-op-linux-30119059703f94e9e4936477bc33e918fb41e9c8.zip |
net: irda: avoid null pointer dereference
Only dereference variable self after checking it is not NULL.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/irda/nsc-ircc.c')
-rw-r--r-- | drivers/net/irda/nsc-ircc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 9ef13d8ed813..aaecc3baaf30 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c @@ -1253,7 +1253,7 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id) */ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) { - struct net_device *dev = self->netdev; + struct net_device *dev; __u8 mcr = MCR_SIR; int iobase; __u8 bank; @@ -1263,6 +1263,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) IRDA_ASSERT(self != NULL, return 0;); + dev = self->netdev; iobase = self->io.fir_base; /* Update accounting for new speed */ |