]> Git Repo - linux.git/commitdiff
iwlwifi: check allocated pointer when allocating conf_tlvs
authorLuca Coelho <[email protected]>
Fri, 6 Mar 2020 13:16:23 +0000 (15:16 +0200)
committerLuca Coelho <[email protected]>
Fri, 6 Mar 2020 13:26:32 +0000 (15:26 +0200)
We were erroneously checking the length of the tlv instead of checking
the pointer returned by kmemdup() when allocating dbg_conf_tlv[].
This was probably a typo.  Fix it by checking the returned pointer
instead of the length.

Reported-by: Markus Elfring <[email protected]>
Signed-off-by: Luca Coelho <[email protected]>
Link: https://lore.kernel.org/r/iwlwifi.20200306151128.06e00e6e980f.I9a890ce83493b79892a5f690d12016525317fa7e@changeid
drivers/net/wireless/intel/iwlwifi/iwl-drv.c

index 2d1cb4647c3be98d3e2fa11bb00d069cb31df7ff..0481796f75bc4019261973872467a3759bfe83e2 100644 (file)
@@ -1467,7 +1467,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
                                kmemdup(pieces->dbg_conf_tlv[i],
                                        pieces->dbg_conf_tlv_len[i],
                                        GFP_KERNEL);
-                       if (!pieces->dbg_conf_tlv_len[i])
+                       if (!pieces->dbg_conf_tlv[i])
                                goto out_free_fw;
                }
        }
This page took 0.061677 seconds and 4 git commands to generate.