staging: gdm72xx: check return value of sscanf

Signed-off-by: Ben Chan <benchan@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ben Chan 2014-06-24 18:11:08 -07:00 committed by Greg Kroah-Hartman
parent 7bb3c79862
commit a29b18573a

View File

@ -291,8 +291,9 @@ static void __gdm_wimax_event_send(struct work_struct *work)
e = list_entry(wm_event.evtq.next, struct evt_entry, list);
spin_unlock_irqrestore(&wm_event.evt_lock, flags);
sscanf(e->dev->name, "wm%d", &idx);
netlink_send(wm_event.sock, idx, 0, e->evt_data, e->size);
if (sscanf(e->dev->name, "wm%d", &idx) == 1)
netlink_send(wm_event.sock, idx, 0, e->evt_data,
e->size);
spin_lock_irqsave(&wm_event.evt_lock, flags);
list_del(&e->list);