]> www.infradead.org Git - users/hch/block.git/commitdiff
sg: pass the device name to blk_trace_setup
authorChristoph Hellwig <hch@lst.de>
Wed, 25 Aug 2021 07:52:44 +0000 (09:52 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 25 Aug 2021 07:53:14 +0000 (09:53 +0200)
Fix a regression that passd a NULL device name to blk_trace_setup
accidentally.

Fixes: aebbb5831fbd ("sg: do not allocate a gendisk")
Reported-by: syzbot+f74aa89114a236643919@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/scsi/sg.c

index 477267add49dd280b03ecfab97e5a82eb94950f3..d5889b4f0fd4056ce62f857589e10047100fb5ef 100644 (file)
@@ -1118,7 +1118,7 @@ sg_ioctl_common(struct file *filp, Sg_device *sdp, Sg_fd *sfp,
                return put_user(max_sectors_bytes(sdp->device->request_queue),
                                ip);
        case BLKTRACESETUP:
-               return blk_trace_setup(sdp->device->request_queue, NULL,
+               return blk_trace_setup(sdp->device->request_queue, sdp->name,
                                       MKDEV(SCSI_GENERIC_MAJOR, sdp->index),
                                       NULL, p);
        case BLKTRACESTART: