diff options
| author | Wentao Liang <vulab@iscas.ac.cn> | 2026-06-09 09:55:05 +0000 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-06-09 09:42:23 -0700 |
| commit | 34b9a83c50660148bde01cde16451dbe78369749 (patch) | |
| tree | 320d1962365afe89a36f3a0423b5e6bec5a6d8b6 /include/linux/stackprotector.h | |
| parent | 92f58587a04c94985fd4a9e3575720b054c432bf (diff) | |
nvmet: fix refcount leak in nvmet_sq_create()
In nvmet_sq_create(), a reference on the ctrl is taken
via kref_get_unless_zero() before calling nvmet_check_sqid().
If nvmet_check_sqid() fails, the function returns the error
directly without releasing the reference, leading to a leak.
Fix this by jumping to the "ctrl_put" label, which already
performs the necessary nvmet_ctrl_put(ctrl). This ensures the
reference is properly released on this error path.
Cc: stable@vger.kernel.org
Fixes: 1eb380caf527 ("nvmet: Introduce nvmet_sq_create() and nvmet_cq_create()")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'include/linux/stackprotector.h')
0 files changed, 0 insertions, 0 deletions
