* [bug report] rocker: Add support for learning FDB through notification
@ 2017-08-10 12:12 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2017-08-10 12:12 UTC (permalink / raw)
To: kernel-janitors
Hello Arkadi Sharshevsky,
The patch 726fd42fc1e3: "rocker: Add support for learning FDB through
notification" from Jun 8, 2017, leads to the following static checker
warning:
drivers/net/ethernet/rocker/rocker_main.c:2789 rocker_switchdev_event()
error: potential null dereference 'switchdev_work->fdb_info.addr'. (kzalloc returns null)
drivers/net/ethernet/rocker/rocker_main.c
2779 INIT_WORK(&switchdev_work->work, rocker_switchdev_event_work);
2780 switchdev_work->rocker_port = rocker_port;
2781 switchdev_work->event = event;
2782
2783 switch (event) {
2784 case SWITCHDEV_FDB_ADD_TO_DEVICE: /* fall through */
2785 case SWITCHDEV_FDB_DEL_TO_DEVICE:
2786 memcpy(&switchdev_work->fdb_info, ptr,
2787 sizeof(switchdev_work->fdb_info));
2788 switchdev_work->fdb_info.addr = kzalloc(ETH_ALEN, GFP_ATOMIC);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Alloc
2789 ether_addr_copy((u8 *)switchdev_work->fdb_info.addr,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Dereference
2790 fdb_info->addr);
2791 /* Take a reference on the rocker device */
2792 dev_hold(dev);
2793 break;
2794 default:
2795 kfree(switchdev_work);
2796 return NOTIFY_DONE;
2797 }
2798
2799 queue_work(rocker_port->rocker->rocker_owq,
2800 &switchdev_work->work);
2801 return NOTIFY_DONE;
2802 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-10 12:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 12:12 [bug report] rocker: Add support for learning FDB through notification Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox