Re: [PATCH 2/5] um: port: Delete three error messages for a failed memory allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> --- a/arch/um/drivers/port_kern.c
> +++ b/arch/um/drivers/port_kern.c
> @@ -87,11 +87,8 @@ static int port_accept(struct port_list *port)
>  	}
>  
>  	conn = kmalloc(sizeof(*conn), GFP_ATOMIC);
> -	if (conn == NULL) {
> -		printk(KERN_ERR "port_accept : failed to allocate "
> -		       "connection\n");
> +	if (!conn)
>  		goto out_close;
> -	}
>  	*conn = ((struct connection)
>  		{ .list 	= LIST_HEAD_INIT(conn->list),
>  		  .fd 		= fd,

I don't see how this eliminates a possible error.  It should behave
exactly the same.  To me, this is an expressiveness issue.

!x is something you use with something that is conceptually a Boolean.

x == NULL is a question about a pointer, which is the case here.

				Jeff
-- 
Jeff Dike
AddToIt
978-254-0789 (o)
978-394-8986 (c)
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux