From: Ben Chan Date: Wed, 25 Jun 2014 01:11:08 +0000 (-0700) Subject: staging: gdm72xx: check return value of sscanf X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a29b18573a23571daf6610eb95ce9d3efaa47f0e;p=linux-beck.git staging: gdm72xx: check return value of sscanf Signed-off-by: Ben Chan Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c index e5e511585122..3081fd46bbda 100644 --- a/drivers/staging/gdm72xx/gdm_wimax.c +++ b/drivers/staging/gdm72xx/gdm_wimax.c @@ -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);