soc: fsl: dpio: fix dereference of pointer p before null check
authorColin Ian King <colin.king@canonical.com>
Fri, 21 Feb 2020 23:11:43 +0000 (23:11 +0000)
committerLi Yang <leoyang.li@nxp.com>
Fri, 21 Feb 2020 23:17:42 +0000 (17:17 -0600)
commit6a7f10c795743a7f81e89df99866d7532811c324
tree7c5e0ad12caf854a5414811d8123d79a9cd87f30
parent3b2abda7d28c69f564c1157b9b9c21ef40092ee9
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: 3b2abda7d28c ("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>
drivers/soc/fsl/dpio/qbman-portal.c