aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2014-10-15 14:33:21 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2014-10-24 10:49:38 -0400
commitfdb4c0ad3e6c35a51544bb7e5553c10433e50b85 (patch)
tree09b379367540dd5ba529c5886a4261e78a8f77e8 /drivers/crypto
parent8c4cef464b90b1638ff01a922d6a34095cc09c0c (diff)
crypto: qat - cleanup coccicheck warning - NULL check before freeing functions
Analyzing with coccinelle MODE=report... Please check for false positives in the output before submitting a patch. When using "patch" mode, carefully review the patch before submitting it. drivers/crypto/qat/qat_dh895xcc/adf_isr.c:191:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. drivers/crypto/qat/qat_dh895xcc/adf_isr.c:208:3-8: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/qat/qat_dh895xcc/adf_isr.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/crypto/qat/qat_dh895xcc/adf_isr.c b/drivers/crypto/qat/qat_dh895xcc/adf_isr.c
index 67ec61e51185..c9212b919b2c 100644
--- a/drivers/crypto/qat/qat_dh895xcc/adf_isr.c
+++ b/drivers/crypto/qat/qat_dh895xcc/adf_isr.c
@@ -186,10 +186,8 @@ static int adf_isr_alloc_msix_entry_table(struct adf_accel_dev *accel_dev)
186 accel_dev->accel_pci_dev.msix_entries.names = names; 186 accel_dev->accel_pci_dev.msix_entries.names = names;
187 return 0; 187 return 0;
188err: 188err:
189 for (i = 0; i < msix_num_entries; i++) { 189 for (i = 0; i < msix_num_entries; i++)
190 if (*(names + i)) 190 kfree(*(names + i));
191 kfree(*(names + i));
192 }
193 kfree(entries); 191 kfree(entries);
194 kfree(names); 192 kfree(names);
195 return -ENOMEM; 193 return -ENOMEM;
@@ -203,10 +201,8 @@ static void adf_isr_free_msix_entry_table(struct adf_accel_dev *accel_dev)
203 int i; 201 int i;
204 202
205 kfree(accel_dev->accel_pci_dev.msix_entries.entries); 203 kfree(accel_dev->accel_pci_dev.msix_entries.entries);
206 for (i = 0; i < msix_num_entries; i++) { 204 for (i = 0; i < msix_num_entries; i++)
207 if (*(names + i)) 205 kfree(*(names + i));
208 kfree(*(names + i));
209 }
210 kfree(names); 206 kfree(names);
211} 207}
212 208