Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp126670imj; Thu, 14 Feb 2019 16:53:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IYyY6/ganTGIfpPkuJ+gMpEkv/XKfWf5E8j4Hf/ZFHzlTbrYCzX+z4s3prrChhw3xedzK0z X-Received: by 2002:a65:6147:: with SMTP id o7mr2640328pgv.356.1550192018131; Thu, 14 Feb 2019 16:53:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550192018; cv=none; d=google.com; s=arc-20160816; b=urz/DH42XoGMNdlsvJcEvGqW3TJZ56NQl+mdMT+Fw2a1nvH/ZgES8ivFilgWinuzHU /K3i90yCZpCvXLOpitzZNe+DwZZ/SqStdCKYdS+s61PKcpAnDlmVrhvUiIEelfayybB2 YH0Cq22qlDmQn+EFxJSId56o4xdiRVjaPWoeISI+bzORKj5WV1+6SqSr4XmgqOmlUHxa p3rfLsZ+m8F4lrQNV7I+M/dYr3Xa1UUKcsklvA4CxiDrN9v0sVhemtoVs9Mpt12HKuXX ZUlRCzCoJRwpH8H82nxJO06qeyT5E+ujfQH90/Lo7k9S4eassNREHT6itDREd+mVemBI jzUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=De1M2uOQLitpM1G0Or/O1X7lkUYE1szLVW86srBvkyw=; b=E7v6J2aClMohbJbt+AhvIlZ7ga58Ar7DWYqYsgmin5Do06x7GTZL+DwClm+HsGOQpI W1VOwAqIBENB259F0AduXRLnlg1njkiNb6EWaKpQL6UIo/nB0mUMZTVQejzOtC8jTuJ5 oheBpkGrBYjpiTAtfSx8zpTQ0JOp2u7gYTfA3rQr2DWgrrv90lCzzaLkIcbGj/JxRD5p sPuUfDjU589+5BLLArEbHm+vLMTuKN/HpDEISEqguQKAIIkEZX5H34LzQEW/wGNgT+rz GkgKXO09wkYokP8YfnSVn4NtRNKIHaqxqJreVO9JwpvBgafvA2Qxq2Cr+YQl3PRyTTGT UeOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NbQpkTDV; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bb1si3836542plb.121.2019.02.14.16.53.22; Thu, 14 Feb 2019 16:53:38 -0800 (PST) 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=@chromium.org header.s=google header.b=NbQpkTDV; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407854AbfBNQWs (ORCPT + 99 others); Thu, 14 Feb 2019 11:22:48 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:40487 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404917AbfBNQWr (ORCPT ); Thu, 14 Feb 2019 11:22:47 -0500 Received: by mail-ua1-f67.google.com with SMTP id c5so295627uaq.7 for ; Thu, 14 Feb 2019 08:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=De1M2uOQLitpM1G0Or/O1X7lkUYE1szLVW86srBvkyw=; b=NbQpkTDVWMEILL4BQaTiRnty4NfyMwvFmoq8FcOjgK1UGq5hnmeJf+p8batXLyWHma YzR9JkxvLZFrP/mI/C3YNSlwuciYyn/xvmuS4VSxRaYP2jZkKULss9BlNZ7THfw7pQ2v WG7p53l8w3xvz6oHSluj3/e78yslBPgKByOcY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=De1M2uOQLitpM1G0Or/O1X7lkUYE1szLVW86srBvkyw=; b=EqKywrFWR//0IQGfFGIB1oLXGQFaYDhO4FsAKzr4I+I1wILIjy/U8iG2PEPh1MacCX 00iYZUV5k0IxFu2Ge3XR21Ef0oNO/Ke4HTh5ppsF4HObd13FtT8hzbEQ1I2QyOnMOrjr dlCY/CETehUY5nWkdQEiFaNp+YCyXDbBAkucnteck9QXDyRoBr5juIX7obDzD3oHTrZx y/g0RobwcVPiKjgzDW16QZvVURjBS4UOqY0gewGnGvwjBHpoAcE+fKMqcWY7zC1EpjuS zol2eIX8CuTRRnzrJtAfxwOW6F+ob3nzSbwtvrRYdbj5ycPZzZQ92aZphD+z2CAnoWCo hdfQ== X-Gm-Message-State: AHQUAuYMZep+Mgp9wkvVEpF6sYf4huYPTqcQxKRrru8DZYNZdDRZAV8i ezNa0QItcvkPYqRzIxnVQrbP+FQa+eU= X-Received: by 2002:ab0:470d:: with SMTP id h13mr2402800uac.122.1550161366101; Thu, 14 Feb 2019 08:22:46 -0800 (PST) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com. [209.85.217.53]) by smtp.gmail.com with ESMTPSA id b1sm2767785vkf.9.2019.02.14.08.22.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 08:22:45 -0800 (PST) Received: by mail-vs1-f53.google.com with SMTP id z18so3981602vso.7 for ; Thu, 14 Feb 2019 08:22:44 -0800 (PST) X-Received: by 2002:a67:c00a:: with SMTP id v10mr2564321vsi.66.1550161364502; Thu, 14 Feb 2019 08:22:44 -0800 (PST) MIME-Version: 1.0 References: <20190214193113.0000609f.zbestahu@gmail.com> In-Reply-To: <20190214193113.0000609f.zbestahu@gmail.com> From: Kees Cook Date: Thu, 14 Feb 2019 08:22:32 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] pstore/ram: Avoid possible failure of dummy device unregister To: Yue Hu Cc: Anton Vorontsov , Colin Cross , Tony Luck , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 14, 2019 at 3:31 AM Yue Hu wrote: > > From 08ac260f36b4c11eb33fa58466462a5e1027bdb3 Mon Sep 17 00:00:00 2001 > From: Yue Hu > Date: Thu, 14 Feb 2019 19:34:16 +0800 > Subject: [PATCH] pstore/ram: Avoid possible failure of dummy device unregister > > If create dummy platform device failed, dummy variable should not > been set as NULL. Because the following platform_device_unregister() > will judge if the dummy is NULL or not, if dummy is NULL nothing > happen for unregister flow. > > Signed-off-by: Yue Hu I've gotten this email a few times today. :) I already replied that this isn't what we want to do: we have to mark it NULL since prior to that it was an ERR_PTR, and will break the unregister. -Kees > --- > fs/pstore/ram.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c > index 4a06675..61bc573 100644 > --- a/fs/pstore/ram.c > +++ b/fs/pstore/ram.c > @@ -994,7 +994,6 @@ static void __init ramoops_register_dummy(void) > if (IS_ERR(dummy)) { > pr_info("could not create platform device: %ld\n", > PTR_ERR(dummy)); > - dummy = NULL; > ramoops_unregister_dummy(); > } > } > -- > 1.9.1 > -- Kees Cook