Skip to content

Commit

Permalink
net: irda: avoid null pointer dereference
Browse files Browse the repository at this point in the history
Only dereference variable self after checking it is not NULL.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
xypron authored and davem330 committed May 19, 2016
1 parent d113412 commit 3011905
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/irda/nsc-ircc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 */
Expand Down

0 comments on commit 3011905

Please sign in to comment.