Linux block layer
 help / color / mirror / Atom feed
* [bug report] skd: Avoid that module unloading triggers a use-after-free
@ 2017-08-24 11:04 Dan Carpenter
  2017-08-24 15:04 ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-08-24 11:04 UTC (permalink / raw)
  To: bart.vanassche; +Cc: linux-block

Hello Bart Van Assche,

This is a semi-automatic email about new static checker warnings.

The patch 7277cc67b391: "skd: Avoid that module unloading triggers a 
use-after-free" from Aug 17, 2017, leads to the following Smatch 
complaint:

drivers/block/skd_main.c:3080 skd_free_disk()
	 error: we previously assumed 'disk' could be null (see line 3074)

drivers/block/skd_main.c
  3073	
  3074		if (disk && (disk->flags & GENHD_FL_UP))
                    ^^^^
Existing code checked for NULL.  The new code shuffles things around.

  3075			del_gendisk(disk);
  3076	
  3077		if (skdev->queue) {
  3078			blk_cleanup_queue(skdev->queue);
  3079			skdev->queue = NULL;
  3080			disk->queue = NULL;
                        ^^^^^^^^^^^
Now we don't check here.

  3081		}
  3082	

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-25 20:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-24 11:04 [bug report] skd: Avoid that module unloading triggers a use-after-free Dan Carpenter
2017-08-24 15:04 ` Bart Van Assche
2017-08-24 18:36   ` Dan Carpenter
2017-08-25 20:23     ` Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox