[PATCH] s390: drop redundant NULL pointer checks before kfree()

From: Jesper Juhl (juhl-lkml_at_dif.dk)
Date: 04/11/05

  • Next message: Miklos Szeredi: "Re: [RFC] FUSE permission modell (Was: fuse review bits)"
    Date:	Mon, 11 Apr 2005 21:46:18 +0200 (CEST)
    To: Martin Schwidefsky <schwidefsky@de.ibm.com>
    
    

    (please keep me on CC when replying)

    Checking for NULL before calling kfree() on a pointer is redundant. This
    patch drops such checks from arch/s390/

    Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

    ---
     extmem.c |    8 ++++----
     1 files changed, 4 insertions(+), 4 deletions(-)
    diff -upr linux-2.6.12-rc2-mm3-orig/arch/s390/mm/extmem.c linux-2.6.12-rc2-mm3/arch/s390/mm/extmem.c
    --- linux-2.6.12-rc2-mm3-orig/arch/s390/mm/extmem.c	2005-03-02 08:38:17.000000000 +0100
    +++ linux-2.6.12-rc2-mm3/arch/s390/mm/extmem.c	2005-04-11 21:40:10.000000000 +0200
    @@ -234,8 +234,8 @@ query_segment_type (struct dcss_segment 
     	rc = 0;
     
      out_free:
    -	if (qin) kfree(qin);
    -	if (qout) kfree(qout);
    +	kfree(qin);
    +	kfree(qout);
     	return rc;
     }
     
    @@ -394,7 +394,7 @@ __segment_load (char *name, int do_nonsh
     				segtype_string[seg->vm_segtype]);
     	goto out;
      out_free:
    -	kfree (seg);
    +	kfree(seg);
      out:
     	return rc;
     }
    @@ -505,7 +505,7 @@ segment_modify_shared (char *name, int d
     	list_del(&seg->list);
     	dcss_diag(DCSS_PURGESEG, seg->dcss_name,
     		  &dummy, &dummy);
    -	kfree (seg);
    +	kfree(seg);
      out_unlock:
     	spin_unlock(&dcss_lock);
     	return rc;
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Miklos Szeredi: "Re: [RFC] FUSE permission modell (Was: fuse review bits)"

    Relevant Pages

    • Re: [PATCH 2.6] Altix updates
      ... bogus, please decide whether you want to pass a pointer to the pcibr_soft ... Also while the pic.h changes look okay they will conflict with a patch ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [linux-usb-devel] Re: Finding user/kernel pointer bugs [no html]
      ... The right place to apply this patch is in video_usercopy. ... When video_usercopyis used in the ioctl() method, ... which should already receive the __user pointer to arg. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC, 2.6] a simple FIFO implementation
      ... > for coding a fifo queue with just a put and get pointer. ... This is identical to my patch (minus the fact that 'start' is called ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [BUG REPORT 2.6.0] cisco airo_cs scheduling while atomic
      ... I suspect that this part of the patch to airo.c is incorrect. ... the range pointer is derived from the char *extra ... iw_range and the memset is only supposed to clear the first member. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: 2.6.0-test7-mm1
      ... > pointer. ... Here is the patch with the ppc64 bits in it. ... diff -puN kernel/sched.c~spinlock_sleep kernel/sched.c ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)