From nobody Tue Dec 23 14:23:46 2025 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 888ED1B4236 for ; Mon, 13 Jan 2025 06:16:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736748962; cv=none; b=MF/+aXuSPCrmCtkNm1ZFNitO5knS7DoR5F4A6sZlsDTTBPrLPHs7V1a1oGWSwuhxGAhDke/iQBqGXiK6bRntlZlG59C0XuGWBsMqMZDuY0yEBuUntWDxpz5nQ5Cy6h8h3SMWw0Qi7icSZuuCNvnwvyjfoVemZeg2AtdtmUoB3xs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736748962; c=relaxed/simple; bh=HDIQlLSSIWxnjcOUeF2giiJnQXHfIYD0kokOmD+7EWw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=hNk4UtJCZjaUfcsgVQZ6F02CHieVYa8xnZp2E2h0mdcaKlbw5uNMNpLGTFSR5mRZ2M+CAbpksqNTXblqmIz3iaJTunQY0mxxjgN147lsIE+tkOgg2TMhWUqIrH0HC/+H07VMs1pC5u7xKTi/7jMnhQ5pC83Gx59wfaCwfqv6BpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ihd6Kn3F; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ihd6Kn3F" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso6494041a12.3 for ; Sun, 12 Jan 2025 22:16:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736748959; x=1737353759; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=/pjJbm+GL3xMGT2PHevSgzgHjM9ueX6e0WLe9Qs+akw=; b=Ihd6Kn3FkxeURxRXPXJUVdBVw1v7iOaCLXuOfosE1vSAAlXrFNaMyg1W/DyP1y1C23 Tei1iWQwWc46yiJegF0/Ese1+0/N4qYAOBRxhUt1NoxokZ48avxBTGMP/Y2ia02ixnNN HAgyYKt9rMS8dtGGIRCYlYbq74Cd+Xvn8yvHUWFuGWWNahmS270T9T5yNM+1iaO/C2dW zHwdQbMmmuYRlovfzMVlkQEMdFG9Qse+UVsgQ5VJp6yzFp56lpEuX+QP47APZCpJr+RZ Zua2WTZAY1g//Qyzplq6+Iyhh1Q+vyVgkM00/rTav/OAJHVYqOYXjJOK+uF6Qsf777KQ 1PbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736748959; x=1737353759; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/pjJbm+GL3xMGT2PHevSgzgHjM9ueX6e0WLe9Qs+akw=; b=ux8fMYOUlCN/KP/1u0j3rcozRmUZGYRxIEj604D/gZhmg6flYNTCLqK4u5TxbbkOu7 MQ6IIRzx9MDo7arQlBgSSWi7Axyv+AVMaJX38ug/Mm2i6X8LsgtEUD0wQxLX2nWIxWkn lscaXL+c92lEvC3icDO+yA/Hg8PQWMPG0wt/ElGp6Cbyf2bv1bsI7bTeZUVvI1HCXhaJ JvPyCS9OAS7FflKeMObVHH5PO6ZbzJNF4FlQa+2bFEbwUiNiI0Pll5pBbCnQdQOp6nhR A1PZzUqd/WjJQ4Nsct1XT3t5PpJMR/dlV9oz0OL9GNtnYgiD+ET2xw09J6ZpsryVEBQk i/SQ== X-Forwarded-Encrypted: i=1; AJvYcCUz/l+C6UZD0c3aICVlFj1FD0rSVsYMF940A0ZezX5cLL7Dq6LBdfipNrEvCI8znkT+Jq7KFB+zUocahZU=@vger.kernel.org X-Gm-Message-State: AOJu0YzX1e6defmEFXqCZn5zOqLoevc4xHliuni6VJcKtZfHi6Aopfr1 a/MAFfYcKyLmSLp13fO83Sny1/VMhjFxbvWJRv45w0L8kz5vEADaTafy2nf+umM= X-Gm-Gg: ASbGnctvk6d7pxgC/tFlU5cnRO5wwtyfWbFCqE0W11i85eF3R8gSuLS+b0bTFlPH5wc czk76dw/1onqePORxFPJE/LqKj4YpV+eum4yyMqNeBtCQ2C3obGuBAJyfxwrr2r/BX+5ZPktYhm E335tBIbVeB7EsAfATT2UHGGjxTVXpxwghSX8SoVuBaaRj1eAsdzrYdjaiSCoAB2K63L3C6i2V/ 9jyQQ52G//hpwBcIiLF2Rtlnxm5fpJqpOnOiBPHWpw2T1hsj92pjelY6kaycQ== X-Google-Smtp-Source: AGHT+IGq08j5sMzi1AzMjZ1y83V0c4GO8GFxsXUHAj6RdJN05L0egWonX5MsDLpHWtkmf38w3+RFfg== X-Received: by 2002:a05:6402:27cd:b0:5d3:cf89:bd3e with SMTP id 4fb4d7f45d1cf-5d972e708d2mr40816202a12.30.1736748958783; Sun, 12 Jan 2025 22:15:58 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9903c4477sm4308820a12.51.2025.01.12.22.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jan 2025 22:15:58 -0800 (PST) Date: Mon, 13 Jan 2025 09:15:51 +0300 From: Dan Carpenter To: James Bottomley Cc: Jeremy Kerr , Ard Biesheuvel , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH next] efivarfs: Fix a NULL vs IS_ERR() bug Message-ID: <7f7565d8-ef9f-4e5f-834b-9735db01835a@stanley.mountain> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The kernel_file_open() function doesn't return NULL, it retursn error pointers. Fix the error checking to match. Fixes: eb11e99adef8 ("efivarfs: add variable resync after hibernation") Signed-off-by: Dan Carpenter --- fs/efivarfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 961264f628dc..968e4af7b7e4 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c @@ -492,7 +492,7 @@ static int efivarfs_pm_notify(struct notifier_block *nb= , unsigned long action, /* O_NOATIME is required to prevent oops on NULL mnt */ file =3D kernel_file_open(&path, O_RDONLY | O_DIRECTORY | O_NOATIME, current_cred()); - if (!file) + if (IS_ERR(file)) return NOTIFY_DONE; =20 rescan_done =3D true; --=20 2.45.2