Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3934452pxj; Mon, 21 Jun 2021 09:41:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwW0/rq47MNYuakc7XPIL8P97H+F04RJH1UcJuWbZ3xVhP5IrV6RVZg6TOUJTlxPvloID0 X-Received: by 2002:a17:906:c108:: with SMTP id do8mr8530371ejc.74.1624293706388; Mon, 21 Jun 2021 09:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293706; cv=none; d=google.com; s=arc-20160816; b=0k0QStyCdiextAQBQaysucFjpdqniO1wgn88Rib1YV83cEwSGv9fzNkH5CtAAG8/v3 +1wmsY59h7k/TIXu4moLRv3JvL0VQwxhBeZAlGH0b6pTTdnSKOmRKixuOkpzgzCHfepB BshsPX9jGktsPEP/jKTi2xakMvD+LxTyWdGV1vqvpM7Ve3uB/wYIJva3vOYhxABhBmD1 S/FGRn70T7YEe1N08NTTcpcKMG1WRYCaMT9W7YcCN5WsX+HVjhI6I3qQDZemKKW1Pq3H L4L14H1KhgCAZqLm4E/iqNm5AeWiUjcRGC7xwI6NxA5gjkmmsv/iv5RB6mWhwDfhoVNc mi5Q== 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=CejsbN4Smn408iUhakxQZqlTLelZjqB++GcQU0Clmerqmamgl19bl7dLRKYXtC87Fp LqB1H84srawWwxGzMlS2lK0kknFjP9j7H3jOmdCEguWgJBZathuZVuNjoCOSy2LsWPST Woe8CG+zZ8GQgM2TwAi6skiC9yU3XC8rbK02rTfhV4EZ+/tZIv9yxNDgadKeaiLDqENf a55TI3xD1KEP+aZl1LwahUT6j0fTZB7X6DbVxJWwPAUm6KLkTnzU1p7xO3766CF3bTt3 32clZCaYHOsoCMz003g9NPpwGd2AVpDYBzoCKXBknYHecD17LQMFlwr3eZPh95ddGR0/ 7fDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qGgC1ysT; 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 v13si21060176edl.474.2021.06.21.09.41.24; Mon, 21 Jun 2021 09:41:46 -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=qGgC1ysT; 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 S231793AbhFUQkY (ORCPT + 99 others); Mon, 21 Jun 2021 12:40:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:54546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232391AbhFUQgQ (ORCPT ); Mon, 21 Jun 2021 12:36:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3A6E561423; Mon, 21 Jun 2021 16:28:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292901; bh=p0DFBrSnvxVD4MSeELjn0doLekILJPIc78yHqPnq5xU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qGgC1ysTFC8JrY1X9Nwsz0A0ehKIxn/bm5ZONBAsqZYIx4eo65AMT/WjWpMHXHgsm HrVKrQotrYRARKYmDib5mR4nbwkMc+RzP4Wemmvby/rEv/wXeIOigG8EGpCp0PySmL jLmhfjpaFw2jDbdoA/fv0hHhPwHf9cuCxPIXAuw4= 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.12 009/178] afs: Fix an IS_ERR() vs NULL check Date: Mon, 21 Jun 2021 18:13:43 +0200 Message-Id: <20210621154921.805442499@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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