Re: [PATCH ipsec-next] xfrm: fix 'passing zero to ERR_PTR()' warning

From: Steffen Klassert
Date: Fri Jul 27 2018 - 01:37:33 EST


On Wed, Jul 25, 2018 at 04:54:33PM +0800, YueHaibing wrote:
> Fix a static code checker warning:
>
> net/xfrm/xfrm_policy.c:1836 xfrm_resolve_and_create_bundle() warn: passing zero to 'ERR_PTR'
>
> xfrm_tmpl_resolve return 0 just means no xdst found, return NULL
> instead of passing zero to ERR_PTR.
>
> Fixes: d809ec895505 ("xfrm: do not assume that template resolving always returns xfrms")
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>

Applied, thanks a lot!