Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp247507ybg; Thu, 17 Oct 2019 22:20:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB/2vg6Ubv4Cnt1XKVbbZEZXcsZ7R2HiZTZd2f8FPO2A3G2MCdzCYOqh9WQEwn0ASv3jsX X-Received: by 2002:a17:906:1fc8:: with SMTP id e8mr7013065ejt.86.1571376046534; Thu, 17 Oct 2019 22:20:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571376046; cv=none; d=google.com; s=arc-20160816; b=brYFVFUQjrnBV2cYR97y3eJ+mk7uN1AcHfQINKeYMA7OWyXUnTsZF4znZdGWsFLSs/ i1zzWSEsUdWVzahG6LBW1+QFYKPumZDyHw7VLKVsNKDfVO7E+RvtihDFqh68ZQBX49pO sYvA+giIlo6a1AcV99SERuzqhj8o3ih+mdETcuZrlRhk285mc/Vx6rKp1Lk1RNWosjPZ j+CtB0nXo117270mTpnIz+C9IyBGqiTm5gcTGi2LCr51fSWsym8JhQraY3mAkawPoCHF Cd8B6jeqxUgLHJgFywKzqpjhbt7KFtOGR1fKF3Dmk1i/c7RFxx6MNeK1qZrN++MCRAb8 wiPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=ePR8/62tTCV9RgFvpCZdnwGUvBiPGJw/lxcq6lSwPM4=; b=r2y7SCtZA5VIKz7GkqILAhrc5+UObIk7DnRzcNy9coPC7dLAsFY7qj6ZCYwsAnlarS Bbiznt5+9sbuh5GlUqlBqoSlAw2H5cjpImvLwCylpsLey90rkpe9MZlmctKkNLmw1Vsy IauTPPnaOmN89OCVrEXuLErZ3dHBCdOEVFdobTc4FENZKkUbYAoNDKbqxMvGCi+MlUSg tZNDRlpFBuK+nFNI5mC4uR58Zs0eoKRzy5OJS0p+3G5gjSAQzms65U6EnZFgDqY1cUyV rvxdWBGmdme1JmhsvtIhn3G0+dd/aEEsyLa1Tr3iMq5KIk4CZjeYmgYV+QoIS0t4akBc UlVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=dzbRP1Y3; 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 z10si2709462ejx.236.2019.10.17.22.20.23; Thu, 17 Oct 2019 22:20:46 -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=@nifty.com header.s=dec2015msa header.b=dzbRP1Y3; 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 S2395452AbfJQABh (ORCPT + 99 others); Wed, 16 Oct 2019 20:01:37 -0400 Received: from conssluserg-03.nifty.com ([210.131.2.82]:46580 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727859AbfJQABh (ORCPT ); Wed, 16 Oct 2019 20:01:37 -0400 Received: from mail-vk1-f182.google.com (mail-vk1-f182.google.com [209.85.221.182]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x9H01SqF029001; Thu, 17 Oct 2019 09:01:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x9H01SqF029001 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1571270489; bh=ePR8/62tTCV9RgFvpCZdnwGUvBiPGJw/lxcq6lSwPM4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=dzbRP1Y31JzhX9BNHKICCH6zsVtJmG82lxYJpYOb+3NC7vVZM3X8lvOTtkNyR2kqV mQo5yi7s/mjTM/Mmfb+GNVJO1/9dPkmrntIbupNDmqnr2IALvgmo+tQMw3o6Zj+kal ID7GZR4kLSGYyVCUKfBN14YkdSbLpoUgFL0XNkAd9VC0GYjDjxjge74wDakY7CXwvU drzIiInnKCXKIfFlS53jEu9LM1mZK4bp9T71NT/Fe3fgaF0IXiKSHbKpnV0BBfkdtH SsVIbO7Rslu6nl30AJruW+gswIequS+z2l5NLAUTWePZi8y3b26/R5INVwwuqYiyki len2PZ/LJAmcQ== X-Nifty-SrcIP: [209.85.221.182] Received: by mail-vk1-f182.google.com with SMTP id w3so110240vkm.3; Wed, 16 Oct 2019 17:01:29 -0700 (PDT) X-Gm-Message-State: APjAAAX7574wub97hpEIxzT+UrBKIiOZA0/9W0q4QkzQszp05NTwyYGU pohmTyL1BzjmzPNH8mQ8QS9838gGgOtfmXca25s= X-Received: by 2002:a1f:1881:: with SMTP id 123mr464954vky.26.1571270488067; Wed, 16 Oct 2019 17:01:28 -0700 (PDT) MIME-Version: 1.0 References: <20191015064906.13833-1-efremov@linux.com> In-Reply-To: <20191015064906.13833-1-efremov@linux.com> From: Masahiro Yamada Date: Thu, 17 Oct 2019 09:00:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] modpost: add NOFAIL to strdup call To: Denis Efremov Cc: Linux Kbuild mailing list , Michal Marek , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 3:49 PM Denis Efremov wrote: > > Add NOFAIL check for the strdup call, since the function > allocates memory and can return NULL. All strdup calls in > modpost are checked with NOFAIL. > > Signed-off-by: Denis Efremov > --- > scripts/mod/modpost.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c > index 936d3ad23c83..8e8975065cbc 100644 > --- a/scripts/mod/modpost.c > +++ b/scripts/mod/modpost.c > @@ -384,7 +384,7 @@ static struct symbol *sym_add_exported(const char *name, const char *namespace, > } > } > free(s->namespace); > - s->namespace = namespace ? strdup(namespace) : NULL; > + s->namespace = namespace ? NOFAIL(strdup(namespace)) : NULL; This is correct, but I will put it off because otherwise if would cause a conflict against this patch: https://lore.kernel.org/patchwork/patch/1138151/ That patch is adding NOFAIL(). > s->preloaded = 0; > s->vmlinux = is_vmlinux(mod->name); > s->kernel = 0; > -- > 2.21.0 > -- Best Regards Masahiro Yamada