]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-mac: Fix potential null pointer dereference
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 25 Sep 2020 17:03:23 +0000 (12:03 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 26 Sep 2020 00:15:37 +0000 (17:15 -0700)
commit6efd86e861753ff53ca70b9e98bbe7dd47cc0c4e
tree227fc76e88a1131729b25983ebddcc2c9c93be43
parent238ce658eeb77efa4e419bdcb9512f36fc42be0e
dpaa2-mac: Fix potential null pointer dereference

There is a null-check for _pcs_, but it is being dereferenced
prior to this null-check. So, if _pcs_ can actually be null,
then there is a potential null pointer dereference that should
be fixed by null-checking _pcs_ before being dereferenced.

Addresses-Coverity-ID: 1497159 ("Dereference before null check")
Fixes: 2f50e8210880 ("dpaa2-mac: add PCS support through the Lynx module")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c