Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3777360pxv; Mon, 28 Jun 2021 12:36:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6SwUVYL3oGnAP+yXFRtbsGS4FnnAFZz6ZqMi/MClRmACU9zubJQT2R/1zmDyN9ApyjG+b X-Received: by 2002:a02:942e:: with SMTP id a43mr1098176jai.74.1624908982943; Mon, 28 Jun 2021 12:36:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624908982; cv=none; d=google.com; s=arc-20160816; b=sP1NLAmAiDtrgr7FE7hpU9YpmBtVxGqTyJ4japYWIfxyTcON13wd25dN5rkFIiobyv svGzJ6j2XChAlsnI6FZKugh76PENUD9AVTAtb7UqL8fE4CudcZ1EObQma7h3wyMTN4VJ U6te//CrZtYhpK4BUlIPLDVgtrCgBMDO4i/XK+xJLCkktVMB3EgsZwBIzLEsp+cUUg/o VqMiTlxjAfuCFJTdDYeBds+H2d5SajAUlNOwD2Zvy9Mk34WbVkjQgnLP4YiJmPm/2RN8 rao5JX7mPM/C/pDG0rD0/psYbpdu/lw6geAA4/8wgiS0vsSuwcR6RZgThAtuXDuZZ+UP kOdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FDNnn/t3QPSuNCdTRaMZMkxcnBgIfKAtSCdwXkq8Vvs=; b=H28tyToKNDDxKJTs6TCc2HKMoc6m1jQwlJCg2zW8Q1/YmCaihxZ+UQr2mQkZsorWSN wKp/khCrZSJt1c5cAaqTd1+1zKvV99KiRsjbG2YrXRjG33638mkERk/Jt4YU7x0meaGS pjMZqUtAWseNzB67pWQvA9mHXb7db2yS6sZOH9A272ZA5J50smXlZXkg01MY5ds5ZBQZ vUmn7QbGT0huh5WKJN4sPSsarBYZfDTxSW9TbrLK0CxpHg3kLxJOPgKCZMumbdlcKQhO ijbUn4ZrQ1A0y+RIFnDeDZFdpq0IxWlhDuShr0X3YyfRmf4NV3I/csrdbvIWTvmfT+CX Df4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V6Dq7A6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c24si19297474ioh.52.2021.06.28.12.36.08; Mon, 28 Jun 2021 12:36:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V6Dq7A6C; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236740AbhF1Oz7 (ORCPT + 99 others); Mon, 28 Jun 2021 10:55:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:51478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234286AbhF1Olk (ORCPT ); Mon, 28 Jun 2021 10:41:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE94B61CD7; Mon, 28 Jun 2021 14:33:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624890808; bh=mIphc923MT/SJC4o6GY1cJZr2BKPwWjDg4vObfGIzbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V6Dq7A6CYUXOQtaPv7TXiYdVu15bsoBrOYcfglba1Ou8nsAaAVdvOzB8sufJsmUbd d5VMwL4NUEm6i1EzT4Sx+aqQnam39nvq/Rxu84a2Pjs3Z6b8k4Up1gWDNhhH7VDRoj FZ8yDStfxcHjeu71V1Csi9D7VFSuzD9Sk/P331u+gwEg1EXit3fZ0NIjVcOvMQH8TK I56Vw6KG/WUL43coTRkJELUJ+zZaA/px7ce1l2nylDL3ti+Xfmhk5KenOEVB6oDbw4 Vl+Q+HmNa3je/1xQGS1pJ/jsL2gTC98dFb5Ufukg2umn8EHrEI2copjYOPvuGtCf3C HB7YFLn65XPxw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Dan Carpenter , David Howells , linux-afs@lists.infradead.org, Linus Torvalds , Sasha Levin Subject: [PATCH 4.19 024/109] afs: Fix an IS_ERR() vs NULL check Date: Mon, 28 Jun 2021 10:31:40 -0400 Message-Id: <20210628143305.32978-25-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143305.32978-1-sashal@kernel.org> References: <20210628143305.32978-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.196-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.196-rc1 X-KernelTest-Deadline: 2021-06-30T14:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit a33d62662d275cee22888fa7760fe09d5b9cd1f9 ] The proc_symlink() function returns NULL on error, it doesn't return error pointers. Fixes: 5b86d4ff5dce ("afs: Implement network namespacing") Signed-off-by: Dan Carpenter Signed-off-by: David Howells cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/YLjMRKX40pTrJvgf@mwanda/ Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- fs/afs/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/afs/main.c b/fs/afs/main.c index 8ecb127be63f..2eecb2c0a3c0 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -200,8 +200,8 @@ static int __init afs_init(void) goto error_fs; afs_proc_symlink = proc_symlink("fs/afs", NULL, "../self/net/afs"); - if (IS_ERR(afs_proc_symlink)) { - ret = PTR_ERR(afs_proc_symlink); + if (!afs_proc_symlink) { + ret = -ENOMEM; goto error_proc; } -- 2.30.2