lkml.org 
[lkml]   [2006]   [Nov]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    DateMon, 27 Nov 2006 13:59:22 +0900
    FromAkinobu Mita <>
    Subject[PATCH] fix create_write_pipe() error check
    The return value of create_write_pipe()/create_read_pipe() should be
    checked by IS_ERR().
    
    Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
    
    ---
     kernel/kmod.c |    8 ++++----
     1 file changed, 4 insertions(+), 4 deletions(-)
    Index: work-fault-inject/kernel/kmod.c
    ===================================================================
    --- work-fault-inject.orig/kernel/kmod.c
    +++ work-fault-inject/kernel/kmod.c
    @@ -307,14 +307,14 @@ int call_usermodehelper_pipe(char *path,
     		return 0;
     
     	f = create_write_pipe();
    -	if (!f)
    -		return -ENOMEM;
    +	if (IS_ERR(f))
    +		return PTR_ERR(f);
     	*filp = f;
     
     	f = create_read_pipe(f);
    -	if (!f) {
    +	if (IS_ERR(f)) {
     		free_write_pipe(*filp);
    -		return -ENOMEM;
    +		return PTR_ERR(f);
     	}
     	sub_info.stdin = f;
     
    -
    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/
    
    \
     
     \ /
      Last update: 2006-11-27 06:09    [from the cache]
    ©2003-2008