Skip to content
Commit 26b7d1a2 authored by Xiang Yang's avatar Xiang Yang Committed by Leon Romanovsky
Browse files

IB/uverbs: Fix an potential error pointer dereference



smatch reports the warning below:
drivers/infiniband/core/uverbs_std_types_counters.c:110
ib_uverbs_handler_UVERBS_METHOD_COUNTERS_READ() error: 'uattr'
dereferencing possible ERR_PTR()

The return value of uattr maybe ERR_PTR(-ENOENT), fix this by checking
the value of uattr before using it.

Fixes: ebb6796b ("IB/uverbs: Add read counters support")
Signed-off-by: default avatarXiang Yang <xiangyang3@huawei.com>
Link: https://lore.kernel.org/r/20230804022525.1916766-1-xiangyang3@huawei.com


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 9e03dbea
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