]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
caif_virtio: fix wrong pointer check in cfv_probe()
authorVitaliy Shevtsov <v.shevtsov@mt-integration.ru>
Thu, 27 Feb 2025 18:46:27 +0000 (23:46 +0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:04 +0000 (13:02 +0100)
commit56cddf71cce3b15b078e937fadab29962b6f6643
tree80f92cb23c5870022e40d9e19bc0e47efd8818a4
parent084819b0d8b1bd433b90142371eb9450d657f8ca
caif_virtio: fix wrong pointer check in cfv_probe()

[ Upstream commit a466fd7e9fafd975949e5945e2f70c33a94b1a70 ]

del_vqs() frees virtqueues, therefore cfv->vq_tx pointer should be checked
for NULL before calling it, not cfv->vdev. Also the current implementation
is redundant because the pointer cfv->vdev is dereferenced before it is
checked for NULL.

Fix this by checking cfv->vq_tx for NULL instead of cfv->vdev before
calling del_vqs().

Fixes: 0d2e1a2926b1 ("caif_virtio: Introduce caif over virtio")
Signed-off-by: Vitaliy Shevtsov <v.shevtsov@mt-integration.ru>
Reviewed-by: Gerhard Engleder <gerhard@engleder-embedded.com>
Link: https://patch.msgid.link/20250227184716.4715-1-v.shevtsov@mt-integration.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/caif/caif_virtio.c