staging: wilc1000: fix memory leak in wilc_add_rx_gtk
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 22 Dec 2018 09:08:15 +0000 (03:08 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jan 2019 15:31:09 +0000 (16:31 +0100)
commitfe2570fbf3dfce39996819deeaf1693ac6d7b5a3
treeab13cc5bf32bd6225d207c85e6341fce70f4c35c
parentb62ce02e157afa9b57d7f0625e8c585935f422a5
staging: wilc1000: fix memory leak in wilc_add_rx_gtk

In case *mode* happens to be different than WILC_AP_MODE and
WILC_STATION_MODE, gtk_key is not released, hence leanding
to a memory leak. So, in this case it is safer to release
gtk_key just before returning to callers.

Addresses-Coverity-ID: 1476020 ("Resource leak")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/host_interface.c