提交 5a9df732 编写于 作者: A Adrian Bunk 提交者: Linus Torvalds

drivers/block/cciss.c: fix check-after-use

The Coverity checker spotted that we have already oops'ed if "disk"
was NULL.

Since "disk" being NULL seems impossible at this point this patch
removes the NULL check.
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Acked-by: NMike Miller <mike.miller@hp.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b012d346
......@@ -1582,7 +1582,6 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
* allows us to delete disk zero but keep the controller registered.
*/
if (h->gendisk[0] != disk) {
if (disk) {
struct request_queue *q = disk->queue;
if (disk->flags & GENHD_FL_UP)
del_gendisk(disk);
......@@ -1614,7 +1613,6 @@ static int deregister_disk(struct gendisk *disk, drive_info_struct *drv,
}
put_disk(disk);
}
}
} else {
set_capacity(disk, 0);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册