Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1415418ybi; Sat, 8 Jun 2019 09:13:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzinaL4dlM65WxNK1/PnNaqHcCI4cdxFy1ER1M1MTHKDd9efJVFbW0EUP8upUB22wLNaAdb X-Received: by 2002:a17:902:124:: with SMTP id 33mr359725plb.145.1560010395878; Sat, 08 Jun 2019 09:13:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560010395; cv=none; d=google.com; s=arc-20160816; b=jAuTfa1y1GqOuyEAeGpBbciD5C+pj/+M9L1Z0IwPN/wZGFrA+2d/r0KWKfwcEo2aoO F6tikOVzlLWdDS2d2V1pzAzL6Y5Lsq62yoI2M3IjykFDJaoByBvMb40512tnsL9j6b3+ /NNK0c0YUfqxNp+PNC1uFNOLkzYnUvb7FTnqn6J97dRuDkKyC5EA/IoKo22k0GLsPGNO 2Ew9LSLg+K+WVIWy+sLUi+c7lk0Qsd+BU9Q4BntyAQyh0wAUMEiSZMzU+x2gIilnHGR8 CuTCK6sU11GCR0hw8EMZ6PMG/Lyey3Tw1vnEAf1cMXqDDcn6lN0eeExJwG4iYTwBtENc 2iEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Y4PnFWfBk6Xs11lqTRjbODydzKCSY590i30A9Lot5Po=; b=Avth05sFS40HYWhlsEXHoTTyuapXKxSfUpP4fdTgBCFhWBhtamUzeblbvc5G2cuHmP EreL1kPlAf+Oq+UFczTNv92kBCs45cHv4VIPMAwgsoU0HuxwOwzFLzY0ForTiQ8aADSC E9bJGlL5cs/os+dScf15l69RXVUpv1sq+EQ7K1qNVJp/eivb1rCzFR3DHjRFKP9NdjOV YQC1dsXB+Aj5XUNU5JK0tatcCpvOfUwehNPmrRAoizE8mSMxr+1BlfMQUrNZlycPgMb4 G/L5IdoCCtcFlXI2Jg2JSn2X5D2pmYYpwbgYCv1I3QAlDJbolqjYyJq35TKAkJVsg9MF iBXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZAmZERqk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y138si4605981pfb.3.2019.06.08.09.12.59; Sat, 08 Jun 2019 09:13:15 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZAmZERqk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727211AbfFHQLy (ORCPT + 99 others); Sat, 8 Jun 2019 12:11:54 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33478 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727160AbfFHQLy (ORCPT ); Sat, 8 Jun 2019 12:11:54 -0400 Received: by mail-wr1-f68.google.com with SMTP id n9so5081116wru.0; Sat, 08 Jun 2019 09:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Y4PnFWfBk6Xs11lqTRjbODydzKCSY590i30A9Lot5Po=; b=ZAmZERqkcjVMhfBvtyGFlFVF7SfDPsPuVflNUIMDgFTJKZJH/jgsCCC97PPGBZfcae 47taAPkdlEjs/Zk6jUPAL0ji4LENFSoa4stjQq9EkhalfPmCJnnYccFU3ZUzRLxcNXZY 2ATP8LI8TiBy5RwtfCWihhAfk/Vqbrwa1vn3ZKESDCc97hdQotM4hwrUdmQ2fv0rhuRD apK5TK+Ett7TTuOgQxiweqe5qdtVTx+zq5n6I67jZi+9Bv7P1KtwwbemV92DuJkuUng0 VygrfeVunrTxxH3esjmZ9JsLhAYt2A2gb4yuRXJZXalJKdC0Af1VtioblEte9xw1eLjZ AHJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Y4PnFWfBk6Xs11lqTRjbODydzKCSY590i30A9Lot5Po=; b=GalOrJ+kKm9X/EiigyJ8eoGCyAz9bSJxwkZBz25q20iJsj+3//gLOkUat8M/TLWlEF 0x4n0aduCZo6a1YwADz4EsqW7j4JCsDyttZo2lBQefqsQ7QXVqJWWleLVI7qgoR36ehM 8RnbvPmJJQ1VkshTpifZUuQ/+EkW18N+0kc0Rr20TBetfHfMWZoYDEfYpQlT2ICv+Cbp TX6dr7gb0fwmmNlrfZoNSVhUGbXve8yX8j4AcFcAesONM6NB/7e6W0PXzx5vma1GVY05 8PxCdWfCzYkv4rENuWuwABm9ycxQ+NmJm25w/ix6z8Or4Zud52brJR0pAB4o6DXrWz+d VSAg== X-Gm-Message-State: APjAAAWOCDHFiyJrbz7tG36QOGur18ls1NEQCbdRMkLSvNwuQeWrQzjD PvQ9PpUvdfS+8WHZX3iuoO4= X-Received: by 2002:a5d:514d:: with SMTP id u13mr21348654wrt.77.1560010312591; Sat, 08 Jun 2019 09:11:52 -0700 (PDT) Received: from zhanggen-UX430UQ ([108.61.173.19]) by smtp.gmail.com with ESMTPSA id b2sm7403881wrp.72.2019.06.08.09.11.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Jun 2019 09:11:52 -0700 (PDT) Date: Sun, 9 Jun 2019 00:11:44 +0800 From: Gen Zhang To: jassisinghbrar@gmail.com Cc: thierry.reding@gmail.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH] tegra-hsp: fix a missing-check bug in tegra_hsp_doorbell_create() Message-ID: <20190608161144.GA4090@zhanggen-UX430UQ> References: <20190530011920.GA6490@zhanggen-UX430UQ> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190530011920.GA6490@zhanggen-UX430UQ> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 30, 2019 at 09:19:20AM +0800, Gen Zhang wrote: > In tegra_hsp_doorbell_create(), 'db->name' is allocated by > devm_kstrdup_const(). It returns NULL when fails. So 'db->name' should > be checked. > > Signed-off-by: Gen Zhang > Acked-by: Thierry Reding > --- > diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c > index 11fc9fd..b613c46 100644 > --- a/drivers/mailbox/tegra-hsp.c > +++ b/drivers/mailbox/tegra-hsp.c > @@ -292,6 +292,8 @@ tegra_hsp_doorbell_create(struct tegra_hsp *hsp, const char *name, > db->channel.hsp = hsp; > > db->name = devm_kstrdup_const(hsp->dev, name, GFP_KERNEL); > + if (!db->name) > + return ERR_PTR(-ENOMEM); > db->master = master; > db->index = index; > > --- Can anyone look into this patch? It's acked by Thierry Reding . Thanks Gen