Staging: rtl8192e: printing the wrong array
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 29 May 2013 06:57:36 +0000 (09:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 May 2013 11:46:28 +0000 (20:46 +0900)
Smatch complained that there is an array overflow here.  It looks
like we are supposed to be printing the ->rates_ex[] array which is
slightly larger than the ->rates[] array.  This is a cut and paste
error.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtllib_rx.c

index 8b8a5c661a268feed60866afa4ed93cf146df491..e75364e3eb434b7f8fae42cab33c7ce172991b5e 100644 (file)
@@ -1822,7 +1822,7 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
                                network->rates_ex[i] = info_element->data[i];
                                p += snprintf(p, sizeof(rates_str) -
                                              (p - rates_str), "%02X ",
-                                             network->rates[i]);
+                                             network->rates_ex[i]);
                                if (rtllib_is_ofdm_rate
                                    (info_element->data[i])) {
                                        network->flags |= NETWORK_HAS_OFDM;