OSDN Git Service

staging: wilc1000: refactor scan() to free kmalloc memory on failure cases
authorAjay Singh <ajay.kathat@microchip.com>
Mon, 23 Apr 2018 16:33:03 +0000 (22:03 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:54:13 +0000 (15:54 +0200)
commitfaa6576410817b6191edb92954f679af8f3ec5eb
treea3176748d18fa7254e80bb8de7e132398684d770
parentc9f906810d9bc3de7733691fcd33de39d2b67801
staging: wilc1000: refactor scan() to free kmalloc memory on failure cases

Added changes to free the allocated memory in scan() for error condition.
Also added 'NULL' check validation before accessing allocated memory.
Copied the SSID information in consecutive slots to avoid inbetween
holes while filling into array.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c