staging: slicoss: release firmware before returning
authorDevendra Naga <devendra.aaru@gmail.com>
Sun, 26 Aug 2012 07:12:50 +0000 (12:42 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Sep 2012 21:23:33 +0000 (14:23 -0700)
we request_firmware in slic_card_download_gbrcv and we return out
with out calling release_firmware, where we compare against a
firmware lengths of certain device ids.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/slicoss/slicoss.c

index eb498b8..170e0df 100644 (file)
@@ -528,12 +528,16 @@ static int slic_card_download_gbrcv(struct adapter *adapter)
        index += 4;
        switch (adapter->devid) {
        case SLIC_2GB_DEVICE_ID:
-               if (rcvucodelen != OasisRcvUCodeLen)
+               if (rcvucodelen != OasisRcvUCodeLen) {
+                       release_firmware(fw);
                        return -EINVAL;
+               }
                break;
        case SLIC_1GB_DEVICE_ID:
-               if (rcvucodelen != GBRcvUCodeLen)
+               if (rcvucodelen != GBRcvUCodeLen) {
+                       release_firmware(fw);
                        return -EINVAL;
+               }
                break;
        default:
                ASSERT(0);