Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3742687imm; Mon, 6 Aug 2018 09:49:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcFefBuyrAIYohvS3Gh02n/imcPr4snBEse3wMxu5Z35oy8ZwoOFECfxPkUip4X3P/epXj6 X-Received: by 2002:a63:5815:: with SMTP id m21-v6mr14841592pgb.78.1533574156679; Mon, 06 Aug 2018 09:49:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533574156; cv=none; d=google.com; s=arc-20160816; b=WcgK+tzLKJ+dkkJy7gdLfZQy24mwRpcavxUvDgmogFmDkJGOOgE1G2IFn0UpQGMyTY Zauo0eDTHsTQodRHpjBJL8IFlFhFqpL1jzkJomfN/1BE9LTl3ejdRxAlFC08vrr+VHf1 xAQr/0CzdyipBP35pDydxrev4kY8PMhboE3Wy9r7i7r7CbVvUMrTeqOGOCbqz+HbXboi Yp9EnPU5/NojhVzanstLIN2kOYvDagEvtLjTfaQRYYLjYh0zz7rjZdJoy9+Il2cUxC85 iGdvgNf3t/KYZ6X2LVqNgfzMNYnAOVI/EgBbTvGyvS4gA4yP6MTczCjg0la271GpEc7S TVUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=sxQ9K6qNkNtEKWW0II0jWWjWB3cmkcYgG+3nwAHLudQ=; b=g4dRZxmXUU6uLlY+LjifqZ+y/DS5tg5n/GEsOiO5IqsEKRDvUe3gWbKdzeN+zBfmOT dlydTXMouXmYszHPL3kdrEdwIrk1EN4iw62vP0aOj75NBU86k20rQY7lvcbqjhAbv+An ssyvjsJTN90k5yfhs4YcbovhGSnzh1RNeOMqfjmgR6reY7BLovoqUjgMs8vhas2ZRvPc l1gYcK4r+d8GnvQk8FBljILgqaVifrjtPPunKqdokDB/xEFIjM6kMxwVbxguPA/aU5oR XSxTo56AKg0GF/8VoJtjRgFPk1GSeKfirJp6UqyUX88Z05+GZujSCZSt9Dk3QD8b6/p6 WH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=AjNi6Kpo; 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=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f185-v6si13975636pgc.625.2018.08.06.09.49.02; Mon, 06 Aug 2018 09:49:16 -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=@synopsys.com header.s=mail header.b=AjNi6Kpo; 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=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732544AbeHFSye (ORCPT + 99 others); Mon, 6 Aug 2018 14:54:34 -0400 Received: from smtprelay.synopsys.com ([198.182.47.9]:37060 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727561AbeHFSyd (ORCPT ); Mon, 6 Aug 2018 14:54:33 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id ED94D24E058D; Mon, 6 Aug 2018 09:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1533573878; bh=knN/abJGsjdg7sgOehcHLn36pMRzOAIZnen4sArnVzs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AjNi6KpogeQZzh7CNVm6D1H0yRhy5N6efm8DrcBmWS9fkD4qU4XSpcQUepvtN6Pki qshxKMkP3/GWOIqy6TqFRfpLpqBqaw+ciTKQ0GDvgrRyGWRTlsx1vRUwnd2p6ZI/qy IFgM7SzhU30tR4OXuNsvtpAXQ9tDRmNdwG43AO5dQkoXFUZKOdsuDTbZcSylqiFsB0 OzSzW0AqoS7F9612YMmDSWBEz8AjebvnaEP0lRTqcookmh6YNLtIiP5+e1x72fqm3A zI6hyNeyh3F2K3aQUKDU3LXD37DbDjwzCQzU7A9bIAW5W2yAyah1glQCN+6ZEAy7rr TJoG/XbvAPRPg== Received: from paltsev-e7480.internal.synopsys.com (unknown [10.121.8.86]) by mailhost.synopsys.com (Postfix) with ESMTP id 36E1B522D; Mon, 6 Aug 2018 09:44:36 -0700 (PDT) From: Eugeniy Paltsev To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Vineet Gupta , Alexey Brodkin , Eugeniy Paltsev Subject: [PATCH 2/2] ARC: show_faulting_vma: check file_path for error Date: Mon, 6 Aug 2018 19:44:24 +0300 Message-Id: <20180806164424.32439-2-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180806164424.32439-1-Eugeniy.Paltsev@synopsys.com> References: <20180806164424.32439-1-Eugeniy.Paltsev@synopsys.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return value of file_path() should be validated with IS_ERR() macro. Generic print_vma_addr() implementation was used as an example. Signed-off-by: Eugeniy Paltsev --- arch/arc/kernel/troubleshoot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arc/kernel/troubleshoot.c b/arch/arc/kernel/troubleshoot.c index f7330a3a1c4d..e8d9fb452346 100644 --- a/arch/arc/kernel/troubleshoot.c +++ b/arch/arc/kernel/troubleshoot.c @@ -98,6 +98,8 @@ static void show_faulting_vma(unsigned long address, char *buf) if (vma && (vma->vm_start <= address)) { if (vma->vm_file) { nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1); + if (IS_ERR(nm)) + nm = "?"; } pr_info(" @off 0x%lx in [%s]\n" " VMA: 0x%08lx to 0x%08lx\n", -- 2.14.4