Commit a9874d96 authored by Simon Horman's avatar Simon Horman Committed by Jakub Kicinski
Browse files

nfc: Remove checks for nla_data returning NULL



The implementation of nla_data is as follows:

static inline void *nla_data(const struct nlattr *nla)
{
	return (char *) nla + NLA_HDRLEN;
}

Excluding the case where nla is exactly -NLA_HDRLEN, it will not return
NULL. And it seems misleading to assume that it can, other than in this
corner case. So drop checks for this condition.

Flagged by Smatch.

Compile tested only.

Signed-off-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://patch.msgid.link/20250617-nfc-null-data-v1-1-c7525ead2e95@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4f451b97
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment