s390/vmur: fix irq pointer dereference in int handler
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Fri, 19 Aug 2016 17:57:49 +0000 (19:57 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 20 Sep 2016 12:26:32 +0000 (14:26 +0200)
"irq" in vmur's int handler can be an error pointer. Don't dereference
this pointer in that case.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/char/vmur.c

index 6c30e93ab8fa2533b3f3ccd942e3a1884cf39939..ff18f373af9acbccf0f9ec05887362811d582e21 100644 (file)
@@ -306,10 +306,11 @@ static void ur_int_handler(struct ccw_device *cdev, unsigned long intparm,
 {
        struct urdev *urd;
 
-       TRACE("ur_int_handler: intparm=0x%lx cstat=%02x dstat=%02x res=%u\n",
-             intparm, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat,
-             irb->scsw.cmd.count);
-
+       if (!IS_ERR(irb)) {
+               TRACE("ur_int_handler: intparm=0x%lx cstat=%02x dstat=%02x res=%u\n",
+                     intparm, irb->scsw.cmd.cstat, irb->scsw.cmd.dstat,
+                     irb->scsw.cmd.count);
+       }
        if (!intparm) {
                TRACE("ur_int_handler: unsolicited interrupt\n");
                return;