Ticket #2333: 0001-ar6000-minimise-possibility-of-race-in-ar6000_ioctl_.patch

File 0001-ar6000-minimise-possibility-of-race-in-ar6000_ioctl_.patch, 1.2 KB (added by PaulFertser, 4 years ago)
  • drivers/ar6000/ar6000/wireless_ext.c

    From 42686162533b131ead66ea069a7ae165d63c1bc2 Mon Sep 17 00:00:00 2001
    From: Paul Fertser <fercerpav@gmail.com>
    Date: Sat, 6 Mar 2010 15:44:10 +0300
    Subject: [PATCH 1/2] ar6000: minimise possibility of race in ar6000_ioctl_siwscan
    
    This stupid patch should make driver not do NULL pointer dereference when
    there's a race between scan and removing of the device. As clumsy as the
    rest of the driver, this is not a proper solution, of course.
    
    Screw the anonymous dev who's written the original code!
    
    Signed-off-by: Paul Fertser <fercerpav@gmail.com>
    ---
     drivers/ar6000/ar6000/wireless_ext.c |    3 +++
     1 files changed, 3 insertions(+), 0 deletions(-)
    
    diff --git a/drivers/ar6000/ar6000/wireless_ext.c b/drivers/ar6000/ar6000/wireless_ext.c
    index af78ae0..52a4675 100644
    a b ar6000_ioctl_siwscan(struct net_device *dev, 
    18131813    wait_event_interruptible_timeout(ar6000_scan_queue, ar->scan_complete, 
    18141814                                     5 * HZ); 
    18151815 
     1816    if (ar->arWmiReady == FALSE || ar->arWlanState == WLAN_DISABLED) 
     1817        return -EIO; 
     1818 
    18161819    if (wmi_bssfilter_cmd(ar->arWmi, NONE_BSS_FILTER, 0) != A_OK) { 
    18171820            printk("Couldn't set filtering\n"); 
    18181821            ret = -EIO;