mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
net: page_pool: silence static analysis warnings in page_pool_nl_stats_fill()
nla_nest_start() can return NULL if the skb runs out of space. Jakub: There is no bug here, if nla_nest_start() failed there's not space left in the message. Next nla_put_uint() will also fail and we will exit via nla_nest_cancel() which handles NULL just fine. Various people keep sending us this patch so let's commit this. Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com> Link: https://patch.msgid.link/tencent_A82EBAB365A8B888B66FDCF115A3DCB8880A@qq.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
3cefa8d5e7
commit
36d0d876c4
@@ -135,6 +135,8 @@ page_pool_nl_stats_fill(struct sk_buff *rsp, const struct page_pool *pool,
|
||||
return -EMSGSIZE;
|
||||
|
||||
nest = nla_nest_start(rsp, NETDEV_A_PAGE_POOL_STATS_INFO);
|
||||
if (!nest)
|
||||
goto err_cancel_msg;
|
||||
|
||||
if (nla_put_uint(rsp, NETDEV_A_PAGE_POOL_ID, pool->user.id) ||
|
||||
(pool->slow.netdev->ifindex != LOOPBACK_IFINDEX &&
|
||||
|
||||
Reference in New Issue
Block a user