mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 13:11:31 +00:00
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 <prabhakar.kushwaha@nxp.com> Reported-by: Jose Rivera <german.rivera@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
parent
cd7b3fbcf4
commit
b576d325ac
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue