]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: rtl8192u: r8192U_core: Fix driver_info dereference as a null pointer
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Sat, 7 Feb 2015 14:56:10 +0000 (15:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Mar 2015 00:55:24 +0000 (16:55 -0800)
Fix possible use of use of driver_info as a null pointer in
query_rxdesc_status()
This could happen if stats->RxIs40MHzPacket still has the
default value of zero.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_core.c

index 0d64d2dfd38c734f082e5811c62c1de65911c6d0..8f7a3219eff13e01eb548a622f19f6ea11d0427b 100644 (file)
@@ -4476,13 +4476,10 @@ static void query_rxdesc_status(struct sk_buff *skb,
                skb_pull(skb, stats->RxBufShift + stats->RxDrvInfoSize);
        }
 
-       /* for debug 2008.5.29 */
-
-       //added by vivi, for MP, 20080108
-       stats->RxIs40MHzPacket = driver_info->BW;
-       if (stats->RxDrvInfoSize != 0)
+       if (driver_info) {
+               stats->RxIs40MHzPacket = driver_info->BW;
                TranslateRxSignalStuff819xUsb(skb, stats, driver_info);
-
+       }
 }
 
 static void rtl8192_rx_nomal(struct sk_buff *skb)