From 91f58ae61913b40da35e119017e70b3420c6f3a0 Mon Sep 17 00:00:00 2001 From: Huzaifa Sidhpurwala Date: Mon, 21 Feb 2011 12:58:45 +0530 Subject: [PATCH] USB: serial: mos7720: Fix possible null pointer dereference Signed-off-by: Huzaifa Sidhpurwala Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/mos7720.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 7d3bc9a3e2b6..ae506f4ee29d 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -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__); @@ -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; /* -- 2.20.1