Skip to content
Unverified Commit 9617cd6f authored by Yu Kuai's avatar Yu Kuai Committed by Christian Brauner
Browse files

block: fix module reference leakage from bdev_open_by_dev error path



At the time bdev_may_open() is called, module reference is grabbed
already, hence module reference should be released if bdev_may_open()
failed.

This problem is found by code review.

Fixes: ed5cc702 ("block: Add config option to not allow writing to mounted devices")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240406090930.2252838-22-yukuai1@huaweicloud.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent abe6acfa
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment