Unverified Commit 797ab005 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!14933 scsi: sg: Fix slab-use-after-free read in sg_release()

parents 4d48400e dd5c8981
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -395,7 +395,6 @@ sg_release(struct inode *inode, struct file *filp)

	mutex_lock(&sdp->open_rel_lock);
	scsi_autopm_put_device(sdp->device);
	kref_put(&sfp->f_ref, sg_remove_sfp);
	sdp->open_cnt--;

	/* possibly many open()s waiting on exlude clearing, start many;
@@ -407,6 +406,7 @@ sg_release(struct inode *inode, struct file *filp)
		wake_up_interruptible(&sdp->open_wait);
	}
	mutex_unlock(&sdp->open_rel_lock);
	kref_put(&sfp->f_ref, sg_remove_sfp);
	return 0;
}