]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
USB: ftdi_sio: fix problem when the manufacture is a NULL string
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Feb 2012 17:20:09 +0000 (09:20 -0800)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Thu, 12 Apr 2012 22:14:35 +0000 (15:14 -0700)
commit 656d2b3964a9d0f9864d472f8dfa2dd7dd42e6c0 upstream.

On some misconfigured ftdi_sio devices, if the manufacturer string is
NULL, the kernel will oops when the device is plugged in.  This patch
fixes the problem.

Reported-by: Wojciech M Zabolotny <W.Zabolotny@elka.pw.edu.pl>
Tested-by: Wojciech M Zabolotny <W.Zabolotny@elka.pw.edu.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/ftdi_sio.c

index b02fd5027cce1dd62d9c0799ca00318ed1241cd9..e04bc6065535f9d2d379c54aa6005babac29fa31 100644 (file)
@@ -1751,7 +1751,8 @@ static int ftdi_8u2232c_probe(struct usb_serial *serial)
 
        dbg("%s", __func__);
 
-       if (strcmp(udev->manufacturer, "CALAO Systems") == 0)
+       if ((udev->manufacturer) &&
+           (strcmp(udev->manufacturer, "CALAO Systems") == 0))
                return ftdi_jtag_probe(serial);
 
        return 0;