driver: net: fsl-mc: Check NULL before pointer dereference
PATCH 1/1 driver: net: fsl-mc: Check NULL before pointer dereference
NULL pointer should be checked before any dereference. This patch move memest after the NULL pointer check.
Signed-off-by Prabhakar Kushwaha <[email protected]>
Reported-by Jose Rivera <[email protected]>
--- drivers/net/fsl-mc/dpio/qbman_sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/fsl-mc/dpio/qbman_sys.h +1 -1
@@ -255,11 +255,11 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, s->addr_cena = d->cena_bar; s->addr_cinh = d->cinh_bar; s->cena = (void *)valloc (CONFIG_SYS_PAGE_SIZE ); -memset ((void *)s->cena,0x00 ,CONFIG_SYS_PAGE_SIZE );if (!s->cena) {printf ("Could not allocate page for cena shadow\n" );return -1 ; } +memset ((void *)s->cena,0x00 ,CONFIG_SYS_PAGE_SIZE );#ifdef QBMAN_CHECKING /* We should never be asked to initialise for a portal that isn't in
Signature · 1 line
1.9.1
PATCH 1/1 driver: net: fsl-mc: Check NULL before pointer dereference
Quoted 9 lines · Prabhakar Kushwaha
NULL pointer should be checked before any dereference. This patch move memest after the NULL pointer check.
Signed-off-by Prabhakar Kushwaha <[email protected]>Reported-by Jose Rivera <[email protected]>--- drivers/net/fsl-mc/dpio/qbman_sys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-fsl-qoriq master. Awaiting upstream.
Thanks.
York