Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1915304img; Sat, 23 Mar 2019 16:27:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw069wfzi1i0dCB3+aQ5EzQ4iiVhcWpDgI1JizDqiDgQ9XlNRyDQOLUW7SDMoBca7WCyTcr X-Received: by 2002:a17:902:8d8b:: with SMTP id v11mr17554540plo.241.1553383656429; Sat, 23 Mar 2019 16:27:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553383656; cv=none; d=google.com; s=arc-20160816; b=o/XKEnuG211I8f0yo+K4zsiBRQH2V8x4ZMun2s19H7HCwzavgoLN/KGeXTUBPfwmr7 AAFPUqvBQ7YLWReypWYNF+Cfhw9o7bCguKkhbqFZhdd4GYsh2ADMBiubimoSqR70B9Ia 28A4gK9ByY3FA1SgZeexP1M6CAyrC9wWy0r7KNZyNFM8h1hYBGIVxkXV7uCaW6sKfmS9 bdb3OQKf3ytFWchoQsSQYxmsSBxGu1p14M6XJGCfadfVvTHBdkes+G1IkjpVAG4XIN2b 79XF2CNuScYuecBJTJhWXE8jkt7tyhPGvvXLcu8iS4Kgjy1unV8agIO9iSfvqBzSTTVq WX8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xTcPoy2UwJ8FrDaFPvlnYZR9QLLEZDKavUokOFJMVXE=; b=b1JlcFExRCTBhLSY7JR5odkgvZeMZ9sx3UEl32DI7TsGf9ja85aTi80m5MuzLITgtN 2LZMj+XF14Paxk63qdYS1Nd0oB9XelamdLZChlyQVgTwcw9qN0ews8o4zHzodhwEPYvN o5ADUfiJPAoP+w3I77tm6NHD4btK3PssP5+Zg73xhOU2ar08JoM4r2abdLoTJiXc6emV 40KMAqFrenJuUV2V87Bp+f/GG8aUaP/cTrLYEttdJKC1jOeXUW7/0mEyvba1aKqM/Xzo wW+21IbddUIyitB9CmE9N+P2YnRYG9bO6sxURJsJoTd+lfE7ZknG8qUmlE3jrS/9uMWn iXow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c23si10333105pgj.27.2019.03.23.16.27.08; Sat, 23 Mar 2019 16:27:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727808AbfCWX0C (ORCPT + 99 others); Sat, 23 Mar 2019 19:26:02 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43565 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfCWX0B (ORCPT ); Sat, 23 Mar 2019 19:26:01 -0400 Received: by mail-pf1-f196.google.com with SMTP id c8so3871072pfd.10; Sat, 23 Mar 2019 16:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xTcPoy2UwJ8FrDaFPvlnYZR9QLLEZDKavUokOFJMVXE=; b=XKsIV9MnY1GHvcLpTw6r/hEnNKR8CyJxlOZQTGFUZt1jIdgEiYgwFe5UyO8xQPnmly FTjWe+gXxAPwM1Zn4EeKwQKpsNgkOuNdMbeVak3DMnxrWIrXBxD+vCxz0muK+QhZUjSh Cp3930yM+uBiW/os/DGz23PztQXKqUY3eb0P+UfO72A2ciJEUnZe7uZY45s9ZcaY89yf GfrnZBRDtarNGRUZSQmx+0GiBrVTtOdPzxDU1Mw3fYjrUlLyX3km3uFWljpw2lTCWFVc oHVQDaYDWLT8fSALYkhg0bXCH+fEOWrzcG6aU1JtNQAYxD8tevfdPqbprA9r5HZ4dvT1 GFvw== X-Gm-Message-State: APjAAAX9ikS0oHCXeX1x/pzk2W0hZi5NjhCWksdu4Z2/ZSxyQBAEjFzZ s8IdLFcxLhPPWCqCOAZ+J1cfdCd4 X-Received: by 2002:a17:902:9a95:: with SMTP id w21mr10237549plp.74.1553383560657; Sat, 23 Mar 2019 16:26:00 -0700 (PDT) Received: from asus.site ([2601:647:4000:5dd1:a41e:80b4:deb3:fb66]) by smtp.gmail.com with ESMTPSA id j20sm14975415pfa.158.2019.03.23.16.25.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 16:25:59 -0700 (PDT) Subject: Re: [PATCH] infiniband: cxgb4: fix a potential NULL pointer dereference To: Kangjie Lu Cc: pakki001@umn.edu, Steve Wise , Doug Ledford , Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190309051921.15212-1-kjlu@umn.edu> From: Bart Van Assche Message-ID: <26f51579-c9bc-372d-3659-5cf778845215@acm.org> Date: Sat, 23 Mar 2019 16:25:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/22/19 7:37 PM, Kangjie Lu wrote: >> On Mar 8, 2019, at 11:19 PM, Kangjie Lu wrote: >> get_skb may fail and return NULL. The fix returns "ENOMEM" >> when it fails to avoid NULL dereference. >> >> Signed-off-by: Kangjie Lu >> --- >> drivers/infiniband/hw/cxgb4/cm.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c >> index 8221813219e5..502a54d57e2c 100644 >> --- a/drivers/infiniband/hw/cxgb4/cm.c >> +++ b/drivers/infiniband/hw/cxgb4/cm.c >> @@ -1919,6 +1919,9 @@ 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) >> + return -ENOMEM; >> + > > Can someone review this patch? Thanks. Hi Kangjie, Please change the patch description to the imperative mood (see also https://git.kernel.org/pub/scm/git/git.git/tree/Documentation/SubmittingPatches). A good way to invite feedback is to add a relevant Cc-list to a patch. The output of scripts/get_maintainer.pl can be a good start. Bart.