mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 23:51:37 +00:00
soc: fsl: dpio: fix dereference of pointer p before null check
Pointer p is currently being dereferenced before it is null
checked on a memory allocation failure check. Fix this by
checking if p is null before dereferencing it.
Addresses-Coverity: ("Dereference before null check")
Fixes: 3b2abda7d2
("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Li Yang <leoyang.li@nxp.com>
This commit is contained in:
parent
3b2abda7d2
commit
6a7f10c795
@ -249,10 +249,11 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
|
||||
u32 mask_size;
|
||||
u32 eqcr_pi;
|
||||
|
||||
spin_lock_init(&p->access_spinlock);
|
||||
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
spin_lock_init(&p->access_spinlock);
|
||||
|
||||
p->desc = d;
|
||||
p->mc.valid_bit = QB_VALID_BIT;
|
||||
p->sdq = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user