Skip to content

Commit

Permalink
USB: serial: mos7720: Fix possible null pointer dereference
Browse files Browse the repository at this point in the history
Signed-off-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Huzaifa Sidhpurwala authored and Greg Kroah-Hartman committed Feb 25, 2011
1 parent d866150 commit 91f58ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/usb/serial/mos7720.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ static int mos7720_startup(struct usb_serial *serial)
struct usb_device *dev;
int i;
char data;
u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
u16 product;
int ret_val;

dbg("%s: Entering ..........", __func__);
Expand All @@ -2062,6 +2062,7 @@ static int mos7720_startup(struct usb_serial *serial)
return -ENODEV;
}

product = le16_to_cpu(serial->dev->descriptor.idProduct);
dev = serial->dev;

/*
Expand Down

0 comments on commit 91f58ae

Please sign in to comment.