net: fsl-mc: NULL check dflt_dpbp before dereference
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Mon, 4 Aug 2025 16:56:57 +0000 (17:56 +0100)
committerPeng Fan <peng.fan@nxp.com>
Wed, 27 Aug 2025 07:42:08 +0000 (15:42 +0800)
commit9ca756cee7e8f9d6ecc0a69fa785caabd61f3f6a
treec5e95b36f91a7176c71c6c8132969292de32549b
parent756580d090e5dcb3c45d1f0147cc596ae4efd961
net: fsl-mc: NULL check dflt_dpbp before dereference

In dpbp_exit there is a NULL check for dflt_dpbp after it is
dereferenced a number of times. Instead move the NULL check to early in
the function. Also assign NULL to dflt_dpbp after free in both dpbp_init
and dpbp_exit.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/net/fsl-mc/mc.c