Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562322

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

From Jeff Dike <jdike@addtoit.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/5] um: port: Delete three error messages for a failed memory allocation
Date 2017-01-19 01:20 +0100
Message-ID <t18Cl-2D0-11@gated-at.bofh.it> (permalink)
References <t16qR-15L-15@gated-at.bofh.it> <t16qS-15L-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> --- 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)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/5] um: port: Delete three error messages for a failed memory  allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-18 23:00 +0100
  Re: [PATCH 2/5] um: port: Delete three error messages for a failed  memory allocation Jeff Dike <jdike@addtoit.com> - 2017-01-19 01:20 +0100
    Re: [PATCH 2/5] um: port: Delete three error messages for a failed  memory allocation SF Markus Elfring <elfring@users.sourceforge.net> - 2017-01-19 11:00 +0100

csiph-web