Commit 8b72ed60 authored by Jiaran Zhang's avatar Jiaran Zhang Committed by Yang Yingliang
Browse files

net: hns3: fix the exception when query imp info



mainline inclusion
from mainline-v5.15-rc2
commit 472430a7
category: bugfix
bugzilla: NA
CVE: NA

----------------------------

When the command for querying imp info is issued to the firmware,
if the firmware does not support the command, the returned value
of bd num is 0.
Add protection mechanism before alloc memory to prevent apply for
0-length memory.

Fixes: 0b198b0d ("net: hns3: refactor dump m7 info of debugfs")
Signed-off-by: default avatarJiaran Zhang <zhangjiaran@huawei.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
Reviewed-by: default avatarli yongxin <liyongxin1@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parent f8a1be5b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment