Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3921522pxj; Mon, 21 Jun 2021 09:25:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3C1MBBQuU97HTQfi6Ed/1D9M0rBg9Y93Fif2BQQhs2FcyCJqHQ8hPPm9bu5mQM/5ZqjzY X-Received: by 2002:a17:906:b191:: with SMTP id w17mr26483740ejy.10.1624292709459; Mon, 21 Jun 2021 09:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624292709; cv=none; d=google.com; s=arc-20160816; b=k9LgI07TY48Vjixg3FDYcG0q0G6tDxnd6vsC3aX3mTuuyVuwlP25BLNWM0E7NAVeVX rT6+CN1Qv1ia9rBEQ4n+OyCw361rZvEnevjEca3j7icenUYyFCBkEntDbK7HThFA+mTq UrdppoWQ85YnijFPwflr8lMbVYMvR8jUL/7MHHVXggJ4e2CmJcOlSRJbaAVfQzmNccyG Rgcj6J2e0bZsvFWTxKm9XDV5M1H/irWABBPfJftY4gB2Lm8+1s5uFUpHEL2OBPwctqYS /q2cvpcc8C2lk1Rnv/jEv8SDgNCY1OR4zy9qy4AYL3OjRf3jKz/W+GDhuEzjL0cbBzgo k8NQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gPz1PCHBdMYm9j5AzUw+Un8yx9OYsSsNDreykhhRrus=; b=TEFUe2R1D/qSE+QXVD99n5QP/pCXliJMIcd+pH+ZK9QRuuP2YASk+W+J984T56McG9 rHXiKymxxjhHPEphChFeZA3LO7uOJ8SMZaDH5MN+fkLyCo8T7S3Agf9VB9CHnTtKHqF1 TykOBKmVEzccBXpmiIzWIfhR1INOjdEMNRfnzipDUy436LBD43I6OeJ7sng5dYw/IESg IGK9XOwxPNg0c/ZTVXmG2nMFZJ5yELdn6QDcnsBOOuhBJpzZAhci6TSDiNhC2NVE7Ubw xKDJEnWMxp9cL50VTYTK7UtXl6SJWQDg1V0Kj+pAyeGpEK2MGBp6Bj0aN2kuiprjcR2C NULg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TeggcH0h; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id el8si4884808ejc.231.2021.06.21.09.24.47; Mon, 21 Jun 2021 09:25:09 -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=@linuxfoundation.org header.s=korg header.b=TeggcH0h; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231557AbhFUQ0M (ORCPT + 99 others); Mon, 21 Jun 2021 12:26:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:41818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232071AbhFUQYj (ORCPT ); Mon, 21 Jun 2021 12:24:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 435C061378; Mon, 21 Jun 2021 16:21:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292480; bh=p0DFBrSnvxVD4MSeELjn0doLekILJPIc78yHqPnq5xU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TeggcH0hGLmMuSV0feMiVKIlqjFmBLkdbD+6ww4oTfOaVP32KiiDtypN62ioxMKae IWaOJxZUYeFiatjdNak/vsv0NOj3SVzW+tDnbV47KtkIZIxnGcMffZUyN2XozuEvzC 8mQGKIhROzLWVDdCTPBH4HsIm2QwSv2vjTFq4BIw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , David Howells , linux-afs@lists.infradead.org, Linus Torvalds , Sasha Levin Subject: [PATCH 5.10 008/146] afs: Fix an IS_ERR() vs NULL check Date: Mon, 21 Jun 2021 18:13:58 +0200 Message-Id: <20210621154911.530992343@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 b2975256dadb..179004b15566 100644 --- a/fs/afs/main.c +++ b/fs/afs/main.c @@ -203,8 +203,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