Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a9df732 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds
Browse files

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: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarMike Miller <mike.miller@hp.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b012d346
Loading
Loading
Loading
Loading
+27 −29
Original line number Diff line number Diff line
@@ -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);
	}