]> www.infradead.org Git - users/sagi/libnvme.git/commit
mi: don't return from mi_mctp_submit with a tag held
authorJeremy Kerr <jk@codeconstruct.com.au>
Wed, 24 May 2023 09:29:33 +0000 (17:29 +0800)
committerDaniel Wagner <wagi@monom.org>
Mon, 3 Jul 2023 06:04:43 +0000 (08:04 +0200)
commitbf6ec01aecdfd18db195ab83f5aca74430b2167e
treea1770fc96d20d8c48d2f279deeb3f0fef9abd739
parent4fea83db8328ea788ea8f1001e8ce1cb80ef5fae
mi: don't return from mi_mctp_submit with a tag held

If the poll() times-out or fails, we'll exit early from
nvme_mi_mctp_submit still holding the tag reservation. When using an i2c
transport, this may mean we hold a lock on the i2c bus with no way to
release.

Instead, always drop the tag on function exit.

Fixes: 6a08780 ("mi-mctp: Add timeout support to MCTP transport")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
src/nvme/mi-mctp.c