Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5511069ybp; Tue, 15 Oct 2019 00:15:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjK91ERHC5wvilaZxR/whgWKb8kIyeKx/ukmYjRdNfoO2F3fLfw4wutuFNzArKL0SBS3Fm X-Received: by 2002:a17:906:6a15:: with SMTP id o21mr1783734ejr.79.1571123710872; Tue, 15 Oct 2019 00:15:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571123710; cv=none; d=google.com; s=arc-20160816; b=wRfLc7776fd5ACpVQ4rzeVjWGWWmt2yPw1ndGusU4r3ljeuDSq7fnGVlFw7Gn0hayG ar1EhSB8n2Qvvdy364DhcUoXTWJrqs/xCziou7PaiwwsjTJ51KcT0JgcU/RIpeByo20W 9OyNGudOWtImzq2rTeCN6QKXI2XHKIY8SKsINvMrnHhuNpz4SOth5wTjhxqOYHRZy4F4 eEm1MDadA0iYARJmVyxmeRk2pIvrBV62amqGLQ9tbwY0h4jnx7xg5t4WY0nxCV6DrDEx wGLhnuauhdJNXY37Rbm4NSrUgxMlc0iYCp2lKoDn0mgnppZqLCe2zqgnRcb5J4do+bma ZDBg== 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:mime-version :message-id:date:subject:cc:to:from; bh=6YDCkuyIosdTgrS2ggnxlMMsn3BYyoc4OIOo4KBWaVA=; b=pgHgwI0bxpRpEeAxW6m1PhUjVXjcD+pY743SVLGvSu47GaF5ESeHl1GhAM7qzLHyYp 00fFmW/rpn7xafwrekjYH7uiDvox7DNB5DvwAIoQcBRBbZ3XU1ywKmPgjgroOXXyNjY4 15JhHvlW1fNKNVCKaArTCwFm+byJmAYr8ZiUwHCLx+6NRwENvVJZrZTJgqp/+zHQI2aT Glrz8QsP1yV3SbvZA7+XhQP7W6UpxPTCpLPM5pJLaFHK5C3+FbVtacmUcTHFJP3vXwJc XJhlGABf9DNvCjs633iVozEzkda868x+UiuC7Y0IpKfKgxHYz3RSkVpXej8YiK4w1Aov 7GIQ== 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 f13si13552819eda.277.2019.10.15.00.14.47; Tue, 15 Oct 2019 00:15:10 -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 S1727558AbfJOGtS (ORCPT + 99 others); Tue, 15 Oct 2019 02:49:18 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55148 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfJOGtS (ORCPT ); Tue, 15 Oct 2019 02:49:18 -0400 Received: by mail-wm1-f67.google.com with SMTP id p7so19490955wmp.4; Mon, 14 Oct 2019 23:49:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6YDCkuyIosdTgrS2ggnxlMMsn3BYyoc4OIOo4KBWaVA=; b=UiXmmxjiif1MtPfKCiJ2oyzLdSCxArGJiWgAAQNLU0ejy0okCbQ6xXH5ZDxiO0McRa RHy/wcKJGK1X6CMDb+JRcxHFFrWbWBgxFZ7k/7aiux3ssfqFk8+aKPpLElgiQ6+0tbNL xFMucE3Jt/W9tHJJxSS8JexdYUOx+sIKs9RWJEJNpmFMoZMOZ5F5dAF0VotEoL764mjB AxJU/l88oxk1Wywj2Ey5j/3hht8LHcNcy5Nia+oj1Tv/Gv6z/eZ4I8KNIFIF0/gasmh6 sGBeNq9DeVto4KcJCwF4cDK1isCOPWgLNZ1naiq8vY9uBSwHhBnzSl8wtQbfm2EJx73m H99A== X-Gm-Message-State: APjAAAUS/9FoMufDpnSwsYOR6XCmc9yG0146wZ0oy8mbCOVyvhRzOhCQ yw5VxEBK1t+zii9PISdUMA52conL X-Received: by 2002:a1c:f714:: with SMTP id v20mr18539612wmh.55.1571122154580; Mon, 14 Oct 2019 23:49:14 -0700 (PDT) Received: from localhost.localdomain (broadband-188-32-48-208.ip.moscow.rt.ru. [188.32.48.208]) by smtp.googlemail.com with ESMTPSA id z5sm33680364wrs.54.2019.10.14.23.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 23:49:13 -0700 (PDT) From: Denis Efremov To: linux-kbuild@vger.kernel.org Cc: Denis Efremov , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] modpost: add NOFAIL to strdup call Date: Tue, 15 Oct 2019 09:49:06 +0300 Message-Id: <20191015064906.13833-1-efremov@linux.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; s->preloaded = 0; s->vmlinux = is_vmlinux(mod->name); s->kernel = 0; -- 2.21.0