From: Dan Carpenter Date: Mon, 22 Jul 2013 08:00:53 +0000 (+0300) Subject: staging: gdm72xx: potential use after free in send_qos_list() X-Git-Tag: v3.11-rc3~11^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2a6fed1ceaecf6054627f0ddbd4becf43c997fc;p=profile%2Fcommon%2Fkernel-common.git staging: gdm72xx: potential use after free in send_qos_list() Sometimes free_qos_entry() sometimes frees its argument. I have moved the dereference of "entry" ahead on line to avoid a use after free. Signed-off-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gdm72xx/gdm_qos.c b/drivers/staging/gdm72xx/gdm_qos.c index b795353..cc36924 100644 --- a/drivers/staging/gdm72xx/gdm_qos.c +++ b/drivers/staging/gdm72xx/gdm_qos.c @@ -250,8 +250,8 @@ static void send_qos_list(struct nic *nic, struct list_head *head) list_for_each_entry_safe(entry, n, head, list) { list_del(&entry->list); - free_qos_entry(entry); gdm_wimax_send_tx(entry->skb, entry->dev); + free_qos_entry(entry); } }