These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / net / wireless / rsi / rsi_91x_usb_ops.c
index 1106ce7..de49008 100644 (file)
@@ -146,7 +146,12 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
                return status;
        }
 
+       /* Copy firmware into DMA-accessible memory */
        fw = kmemdup(fw_entry->data, fw_entry->size, GFP_KERNEL);
+       if (!fw) {
+               status = -ENOMEM;
+               goto out;
+       }
        len = fw_entry->size;
 
        if (len % 4)
@@ -158,6 +163,9 @@ static int rsi_load_ta_instructions(struct rsi_common *common)
        rsi_dbg(INIT_ZONE, "%s: num blocks: %d\n", __func__, num_blocks);
 
        status = rsi_copy_to_card(common, fw, len, num_blocks);
+       kfree(fw);
+
+out:
        release_firmware(fw_entry);
        return status;
 }