Patch from Bart Van Assche <bart.vanassche@gmail.com>:

The patch below fixes the checkpatch complaints on kfree():
WARNING: kfree(NULL) is safe this check is probabally not required

This patch has been verified as follows:
- Verified that checkpatch does no longer complain about kfree().
- Verified that make -s clean && make -s iscsi scst && make -s -C srpt
  still works and does not trigger any new compiler warnings.
- Checked that the patch generated by generate-kernel-patch still applies
  cleanly to the 2.6.25.4 kernel, and that the patched kernel tree still
  compiles, installs and boots fine, and that the iscsi-scst, ib_srpt,
  scst_disk and scst_vdisk modules still load.

Note: I'm not sure any of the above verifications did trigger the code paths
changed by this patch.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@402 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2008-05-29 17:24:18 +00:00
parent 2092cff5cd
commit ecb27e7444
4 changed files with 10 additions and 19 deletions
+3 -5
View File
@@ -614,14 +614,12 @@ static void srpt_reset_ioctx(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx)
if (ioctx->n_rdma_ius > 0 && ioctx->rdma_ius) {
struct rdma_iu *riu = ioctx->rdma_ius;
for (i = 0; i < ioctx->n_rdma_ius; ++i, ++riu) {
if (riu->sge)
kfree(riu->sge);
}
for (i = 0; i < ioctx->n_rdma_ius; ++i, ++riu)
kfree(riu->sge);
kfree(ioctx->rdma_ius);
}
if (ioctx->n_rbuf > 1 && ioctx->rbufs)
if (ioctx->n_rbuf > 1)
kfree(ioctx->rbufs);
if (srpt_post_recv(ch->sport->sdev, ioctx))