Commit 4633504c authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe

skd: Make it easier for static analyzers to analyze skd_free_disk()

Although it is easy to see that skdev->disk != NULL if skdev->queue
!= NULL, add a test for skdev->disk to avoid that smatch reports the
following warning:

drivers/block/skd_main.c:3080 skd_free_disk()
         error: we previously assumed 'disk' could be null (see line 3074)
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBart Van Assche <bart.vanassche@wdc.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 795bc1b5
...@@ -3041,7 +3041,8 @@ static void skd_free_disk(struct skd_device *skdev) ...@@ -3041,7 +3041,8 @@ static void skd_free_disk(struct skd_device *skdev)
if (skdev->queue) { if (skdev->queue) {
blk_cleanup_queue(skdev->queue); blk_cleanup_queue(skdev->queue);
skdev->queue = NULL; skdev->queue = NULL;
disk->queue = NULL; if (disk)
disk->queue = NULL;
} }
if (skdev->tag_set.tags) if (skdev->tag_set.tags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment