Skip to content
Commit 866b7a27 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by Jakub Kicinski
Browse files

net: dsa: felix: fix possible NULL pointer dereference

As the possible failure of the allocation, kzalloc() may return NULL
pointer.
Therefore, it should be better to check the 'sgi' in order to prevent
the dereference of NULL pointer.

Fixes: 23ae3a78

 ("net: dsa: felix: add stream gate settings for psfp").
Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220329090800.130106-1-zhengyongjun3@huawei.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 77c9387c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment