mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
fsl/fman: check dereferencing null pointer
[ Upstream commit cc5d229a122106733a85c279d89d7703f21e4d4f ]
Add a safe check to avoid dereferencing null pointer
Fixes: 57ba4c9b56 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Florinel Iordache <florinel.iordache@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
158ccb4f03
commit
2997cea07f
3 changed files with 4 additions and 4 deletions
|
|
@ -1205,7 +1205,7 @@ int dtsec_del_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr)
|
|||
list_for_each(pos,
|
||||
&dtsec->multicast_addr_hash->lsts[bucket]) {
|
||||
hash_entry = ETH_HASH_ENTRY_OBJ(pos);
|
||||
if (hash_entry->addr == addr) {
|
||||
if (hash_entry && hash_entry->addr == addr) {
|
||||
list_del_init(&hash_entry->node);
|
||||
kfree(hash_entry);
|
||||
break;
|
||||
|
|
@ -1218,7 +1218,7 @@ int dtsec_del_hash_mac_address(struct fman_mac *dtsec, enet_addr_t *eth_addr)
|
|||
list_for_each(pos,
|
||||
&dtsec->unicast_addr_hash->lsts[bucket]) {
|
||||
hash_entry = ETH_HASH_ENTRY_OBJ(pos);
|
||||
if (hash_entry->addr == addr) {
|
||||
if (hash_entry && hash_entry->addr == addr) {
|
||||
list_del_init(&hash_entry->node);
|
||||
kfree(hash_entry);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -985,7 +985,7 @@ int memac_del_hash_mac_address(struct fman_mac *memac, enet_addr_t *eth_addr)
|
|||
|
||||
list_for_each(pos, &memac->multicast_addr_hash->lsts[hash]) {
|
||||
hash_entry = ETH_HASH_ENTRY_OBJ(pos);
|
||||
if (hash_entry->addr == addr) {
|
||||
if (hash_entry && hash_entry->addr == addr) {
|
||||
list_del_init(&hash_entry->node);
|
||||
kfree(hash_entry);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ int tgec_del_hash_mac_address(struct fman_mac *tgec, enet_addr_t *eth_addr)
|
|||
|
||||
list_for_each(pos, &tgec->multicast_addr_hash->lsts[hash]) {
|
||||
hash_entry = ETH_HASH_ENTRY_OBJ(pos);
|
||||
if (hash_entry->addr == addr) {
|
||||
if (hash_entry && hash_entry->addr == addr) {
|
||||
list_del_init(&hash_entry->node);
|
||||
kfree(hash_entry);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue