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


Groups > linux.kernel > #1337587

Re: [PATCH] nes: handling failed allocation when creating workqueue

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Doug Ledford <dledford@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH] nes: handling failed allocation when creating workqueue
Date Thu, 18 Feb 2016 18:50:03 +0100
Message-ID <r3ASf-CA-29@gated-at.bofh.it> (permalink)
References <r3eI2-1Fz-11@gated-at.bofh.it> <r3p0J-Bk-3@gated-at.bofh.it>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fFViqQ1N8EBhP0UU4xSSCE2FJQAqThgJC"
X-Scanned-By MIMEDefang 2.68 on 10.5.11.22
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 66
Organization linux.* mail to news gateway
X-Original-Date Thu, 18 Feb 2016 12:45:43 -0500
X-Original-Message-ID <56C60347.7040506@redhat.com>
X-Original-References <1455732393-11029-1-git-send-email-wuninsu@gmail.com> <20160218045905.GF30450@leon.nu>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1337587

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On 2/17/2016 11:59 PM, Leon Romanovsky wrote:
> Please see my minor comments below.
> Reviewed-by: Leon Romanovsky <leon@leon.nu>
> 
> On Wed, Feb 17, 2016 at 01:06:33PM -0500, Insu Yun wrote:
>> Since create_singlethread_workqueue uses kzalloc internally, 
>> it can be failed in memory pressure, so need to handle it.
> 
> s/can be failed/can fail/
> 
>>
>> Signed-off-by: Insu Yun <wuninsu@gmail.com>
>> ---
>>  drivers/infiniband/hw/nes/nes_cm.c | 13 ++++++++++++-
>>  1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
>> index cb9f0f2..23afad6 100644
>> --- a/drivers/infiniband/hw/nes/nes_cm.c
>> +++ b/drivers/infiniband/hw/nes/nes_cm.c
>> @@ -2833,7 +2833,7 @@ static struct nes_cm_core *nes_cm_alloc_core(void)
>>  	/* alloc top level core control structure */
>>  	cm_core = kzalloc(sizeof(*cm_core), GFP_KERNEL);
>>  	if (!cm_core)
>> -		return NULL;
>> +		goto enomem_3;
> 
> IMHO, there is no need to define goto label for one return.

I made the touchups Leon suggested, and a touchup of my own, but it is
now applied, thanks.


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


Thread

[PATCH] nes: handling failed allocation when creating workqueue Insu Yun <wuninsu@gmail.com> - 2016-02-17 19:10 +0100
  Re: [PATCH] nes: handling failed allocation when creating workqueue Leon Romanovsky <leon@leon.nu> - 2016-02-18 06:10 +0100
    Re: [PATCH] nes: handling failed allocation when creating workqueue Doug Ledford <dledford@redhat.com> - 2016-02-18 18:50 +0100

csiph-web