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

Commit 59d3fe54 authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman
Browse files

Staging: zram: Fix variable dereferenced before check



This patch fixes the following Smatch warning in zram_drv.c-
drivers/staging/zram/zram_drv.c:899
destroy_device() warn: variable dereferenced before check 'zram->disk' (see line 896)

Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Acked-by: default avatarJerome Marchand <jmarchan@redhat.com>
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 238822bc
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -896,12 +896,9 @@ static void destroy_device(struct zram *zram)
	sysfs_remove_group(&disk_to_dev(zram->disk)->kobj,
			&zram_disk_attr_group);

	if (zram->disk) {
	del_gendisk(zram->disk);
	put_disk(zram->disk);
	}

	if (zram->queue)
	blk_cleanup_queue(zram->queue);
}