OSDN Git Service

net: wireless: bcmdhd: Check return value from dhd_dev_init_ioctl()
authorDmitry Shmidt <dimitrysh@google.com>
Wed, 16 May 2012 18:26:24 +0000 (11:26 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Wed, 16 May 2012 23:59:25 +0000 (16:59 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c
drivers/net/wireless/bcmdhd/wl_android.c
drivers/net/wireless/bcmdhd/wl_iw.c

index c5f2e86..8a9f795 100644 (file)
@@ -4426,12 +4426,12 @@ int net_os_set_packet_filter(struct net_device *dev, int val)
        return dhd_os_set_packet_filter(&dhd->pub, val);
 }
 
-void
+int
 dhd_dev_init_ioctl(struct net_device *dev)
 {
        dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
 
-       dhd_preinit_ioctls(&dhd->pub);
+       return dhd_preinit_ioctls(&dhd->pub);
 }
 
 #ifdef PNO_SUPPORT
index 631c12b..4fcdcd3 100644 (file)
@@ -115,7 +115,7 @@ typedef struct android_wifi_priv_cmd {
  */
 void dhd_customer_gpio_wlan_ctrl(int onoff);
 uint dhd_dev_reset(struct net_device *dev, uint8 flag);
-void dhd_dev_init_ioctl(struct net_device *dev);
+int dhd_dev_init_ioctl(struct net_device *dev);
 #ifdef WL_CFG80211
 int wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr);
 int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, char *command);
@@ -387,8 +387,10 @@ int wl_android_wifi_on(struct net_device *dev)
                sdioh_start(NULL, 0);
                ret = dhd_dev_reset(dev, FALSE);
                sdioh_start(NULL, 1);
-               if (!ret)
-                       dhd_dev_init_ioctl(dev);
+               if (!ret) {
+                       if (dhd_dev_init_ioctl(dev) < 0)
+                               ret = -EFAULT;
+               }
                g_wifi_on = 1;
        }
        dhd_net_if_unlock(dev);
index 8a8f8a5..095dc86 100644 (file)
@@ -148,7 +148,7 @@ static struct mutex wl_softap_lock;
 #include <bcmsdbus.h>
 extern void dhd_customer_gpio_wlan_ctrl(int onoff);
 extern uint dhd_dev_reset(struct net_device *dev, uint8 flag);
-extern void dhd_dev_init_ioctl(struct net_device *dev);
+extern int dhd_dev_init_ioctl(struct net_device *dev);
 
 uint wl_msg_level = WL_ERROR_VAL;