summaryrefslogtreecommitdiffstats
path: root/drivers/block/skd_main.c
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@wdc.com>2017-08-25 23:24:13 +0200
committerJens Axboe <axboe@kernel.dk>2017-08-25 23:29:43 +0200
commit4633504c1a3a452ff03a5dbe50beb082fa1bfac6 (patch)
tree0e5e1295152df28a13ecb8a9f4ee1b9518ac20a7 /drivers/block/skd_main.c
parentskd: Inline skd_end_request() (diff)
downloadlinux-4633504c1a3a452ff03a5dbe50beb082fa1bfac6.tar.xz
linux-4633504c1a3a452ff03a5dbe50beb082fa1bfac6.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bart 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: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/skd_main.c')
-rw-r--r--drivers/block/skd_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index 8ae0320f02b5..34188a600bfa 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -3041,7 +3041,8 @@ static void skd_free_disk(struct skd_device *skdev)
if (skdev->queue) {
blk_cleanup_queue(skdev->queue);
skdev->queue = NULL;
- disk->queue = NULL;
+ if (disk)
+ disk->queue = NULL;
}
if (skdev->tag_set.tags)