Commit 30119059 authored by xypron.glpk@gmx.de's avatar xypron.glpk@gmx.de Committed by David S. Miller

net: irda: avoid null pointer dereference

Only dereference variable self after checking it is not NULL.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1134128
...@@ -1253,7 +1253,7 @@ static void nsc_ircc_change_dongle_speed(int iobase, int speed, int dongle_id) ...@@ -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) 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; __u8 mcr = MCR_SIR;
int iobase; int iobase;
__u8 bank; __u8 bank;
...@@ -1263,6 +1263,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed) ...@@ -1263,6 +1263,7 @@ static __u8 nsc_ircc_change_speed(struct nsc_ircc_cb *self, __u32 speed)
IRDA_ASSERT(self != NULL, return 0;); IRDA_ASSERT(self != NULL, return 0;);
dev = self->netdev;
iobase = self->io.fir_base; iobase = self->io.fir_base;
/* Update accounting for new speed */ /* Update accounting for new speed */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment