From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8269CC83F2C for ; Tue, 5 Sep 2023 16:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234482AbjIEQBC (ORCPT ); Tue, 5 Sep 2023 12:01:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354555AbjIEMhN (ORCPT ); Tue, 5 Sep 2023 08:37:13 -0400 Received: from gw.red-soft.ru (red-soft.ru [188.246.186.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43CDC1AD; Tue, 5 Sep 2023 05:37:08 -0700 (PDT) Received: from localhost.localdomain (unknown [10.81.81.211]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gw.red-soft.ru (Postfix) with ESMTPSA id 276823E1A8B; Tue, 5 Sep 2023 15:37:05 +0300 (MSK) Date: Tue, 5 Sep 2023 15:37:03 +0300 From: Artem Chernyshev To: Krzysztof Kozlowski Cc: Leon Romanovsky , Potnuri Bharat Teja , Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH] infiniband: cxgb4: cm: Check skb value Message-ID: References: <20230904115925.261974-1-artem.chernyshev@red-soft.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 179655 [Sep 05 2023] X-KLMS-AntiSpam-Version: 5.9.59.0 X-KLMS-AntiSpam-Envelope-From: artem.chernyshev@red-soft.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dkim=none X-KLMS-AntiSpam-Info: LuaCore: 529 529 a773548e495283fecef97c3e587259fde2135fef, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;red-soft.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2023/09/05 05:09:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, bases: 2023/09/05 09:52:00 #21801295 X-KLMS-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Sep 04, 2023 at 10:07:26PM +0200, Krzysztof Kozlowski wrote: > On 04/09/2023 13:59, Artem Chernyshev wrote: > > get_skb() can't allocate skb in case of OOM. > > > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > > > Signed-off-by: Artem Chernyshev > > --- > > drivers/infiniband/hw/cxgb4/cm.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c > > index ced615b5ea09..775da62b38ec 100644 > > --- a/drivers/infiniband/hw/cxgb4/cm.c > > +++ b/drivers/infiniband/hw/cxgb4/cm.c > > @@ -1965,6 +1965,10 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid) > > int win; > > > > skb = get_skb(NULL, sizeof(*req), GFP_KERNEL); > > + if (!skb) { > > + pr_err("%s - cannot alloc skb!\n", __func__); > > I don't think we print memory allocation failures. > > Best regards, > Krzysztof > Sure, will fix that in v2 Thanks, Artem