staging: unisys: dereferencing NULL pointer
authorSudip Mukherjee <sudipm.mukherjee@gmail.com>
Fri, 7 Nov 2014 12:18:35 +0000 (17:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:22:46 +0000 (09:22 -0800)
we can reach the label Away in total five situation and in four of
of them pDevInfo is NULL. so we were basically dereferencing a NULL
pointer.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorchipset/visorchipset_main.c

index b5a0e46..c8f7bea 100644 (file)
@@ -1298,7 +1298,8 @@ my_device_create(struct controlvm_message *inmsg)
                         POSTCODE_SEVERITY_INFO);
 Away:
        /* get the bus and devNo for DiagPool channel */
-       if (is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
+       if (pDevInfo &&
+           is_diagpool_channel(pDevInfo->chan_info.channel_type_uuid)) {
                g_diagpoolBusNo = busNo;
                g_diagpoolDevNo = devNo;
                LOGINF("CONTROLVM_DEVICE_CREATE for DiagPool channel: busNo=%lu, devNo=%lu",