]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: gobi: avoid NULL dereferencing in devqmi_ioctl
authorBen Chan <benchan@chromium.org>
Thu, 27 Dec 2012 00:17:21 +0000 (16:17 -0800)
committerChromeBot <chrome-bot@google.com>
Thu, 27 Dec 2012 23:33:51 +0000 (15:33 -0800)
BUG=chrome-os-partner:16163
TEST=Run suspend/resume stress test on a system with Gobi 3000 modem.

Change-Id: I0a8c78036e4ec3579b0d0bb92697fe4d68f62cdb
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/40229
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
drivers/net/usb/gobi/qmidevice.c

index 0d11bfa9a37e2ce98f54512884914ab16cc18a1b..b3738b1e32dce40cabd6ebd124285da7c602fd7c 100644 (file)
@@ -1216,6 +1216,10 @@ static long devqmi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
        u32 vidpid;
 
        struct qmihandle *handle = (struct qmihandle *)file->private_data;
+       if (!handle) {
+               GOBI_WARN("invalid qmihandle");
+               return -ENXIO;
+       }
 
        GOBI_DEBUG("%p %04x %08x", handle, handle->cid, cmd);