]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dmaengine: idxd: Fix potential null dereference on pointer status
authorColin Ian King <colin.king@canonical.com>
Thu, 15 Apr 2021 11:06:54 +0000 (12:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:41 +0000 (10:29 +0200)
commit2280b4cc29d8cdd2be3d1b2d1ea4f958e2131c97
tree2a88cb583e6cfdb0beabe3dce564716f5b4a9263
parent1f84f1d7711b9369bc07e0b59f56f6d6cdd3430b
dmaengine: idxd: Fix potential null dereference on pointer status

[ Upstream commit 28ac8e03c43dfc6a703aa420d18222540b801120 ]

There are calls to idxd_cmd_exec that pass a null status pointer however
a recent commit has added an assignment to *status that can end up
with a null pointer dereference.  The function expects a null status
pointer sometimes as there is a later assignment to *status where
status is first null checked.  Fix the issue by null checking status
before making the assignment.

Addresses-Coverity: ("Explicit null dereferenced")
Fixes: 89e3becd8f82 ("dmaengine: idxd: check device state before issue command")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Link: https://lore.kernel.org/r/20210415110654.1941580-1-colin.king@canonical.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/dma/idxd/device.c