]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/dasd: check for device error pointer within state change interrupts
authorStefan Haberland <sth@linux.vnet.ibm.com>
Wed, 25 Jan 2017 13:47:32 +0000 (14:47 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 31 Jan 2017 09:47:15 +0000 (10:47 +0100)
Check if the device pointer is valid. Just a sanity check since we already
are in the int handler of the device.

Signed-off-by: Stefan Haberland <sth@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c

index 0e3fdfdbd09846c454987913dfd678c4ec725991..f3099c8cc143b0f3a7cd1624cae5d20e8323cf70 100644 (file)
@@ -1712,8 +1712,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
        /* check for for attention message */
        if (scsw_dstat(&irb->scsw) & DEV_STAT_ATTENTION) {
                device = dasd_device_from_cdev_locked(cdev);
-               device->discipline->check_attention(device, irb->esw.esw1.lpum);
-               dasd_put_device(device);
+               if (!IS_ERR(device)) {
+                       device->discipline->check_attention(device,
+                                                           irb->esw.esw1.lpum);
+                       dasd_put_device(device);
+               }
        }
 
        if (!cqr)