From patchwork Thu Oct 25 15:29:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10656071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 570A514DE for ; Thu, 25 Oct 2018 15:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43A2F2BD42 for ; Thu, 25 Oct 2018 15:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 365542BD6B; Thu, 25 Oct 2018 15:36:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BF9182BD42 for ; Thu, 25 Oct 2018 15:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=IaWX8cuJQ8XK23gnaA8rkCWxXWnW8njjz+TVhgK3fIw=; b=iHNLPfE+sBFSOZTNycMeTbbMGB usdRTMHN3oqLwdcAnTIvN9ag9fPyjmP3WZLtF23+LcQ0IvkOLat44KVOi3j8HJG33HRaqkjCJViJo Ea1xsz493mH/sTBt+g6idS5I1pjpxezYZpvhv7/8KCtYJIr9rGU9qyrG+WEhe6vOfMjLpBlwP0O9O f8Mi+RJ7dk53JYupFaCXzTMo5Ok/4GcMOAeQI4bFjL5V0u58LD9KInRPDqZe9QZY32iNfNWSaa8fj oBpUav0H7SJlBTYvWECoOnb/DYBUS+wbBA2PUaFukwy392FjWaemHx9Klo2gkDZTowTcRZdP91fXw VhZg8afg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFhgT-00048h-Bg; Thu, 25 Oct 2018 15:36:29 +0000 Received: from mout.kundenserver.de ([212.227.126.131]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFhag-0000U3-5d; Thu, 25 Oct 2018 15:30:43 +0000 Received: from localhost.localdomain ([37.4.249.153]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5FxN-1fYICA44vd-0119LN; Thu, 25 Oct 2018 17:30:08 +0200 Received: from localhost.localdomain ([37.4.249.153]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5FxN-1fYICA44vd-0119LN; Thu, 25 Oct 2018 17:30:08 +0200 From: Stefan Wahren To: Eric Anholt , gregkh@linuxfoundation.org, Dave Stevenson Subject: [PATCH RFC 04/11] staging: vchiq_arm: Fix platform device unregistration Date: Thu, 25 Oct 2018 17:29:28 +0200 Message-Id: <1540481375-15952-5-git-send-email-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540481375-15952-1-git-send-email-stefan.wahren@i2se.com> References: <1540481375-15952-1-git-send-email-stefan.wahren@i2se.com> X-Provags-ID: V03:K1:ZpfGsNRdlbw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heID: sfid-20181025_083030_530712_6CD3267F X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Stefan Wahren , linux-arm-kernel@lists.infradead.org, tiwai@suse.de, mikebrady@eircom.net, pbrobinson@gmail.com, nsaenzjulienne@suse.de, linux-rpi-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In error case platform_device_register_data would return an ERR_PTR instead of NULL. So we better check this before unregistration. Fixes: 37b7b3087a2f ("staging/vc04_services: Register a platform device for the camera driver.") Signed-off-by: Stefan Wahren --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index ea78937..d7d7c2f0 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -3672,7 +3672,8 @@ static int vchiq_probe(struct platform_device *pdev) static int vchiq_remove(struct platform_device *pdev) { - platform_device_unregister(bcm2835_camera); + if (!IS_ERR(bcm2835_camera)) + platform_device_unregister(bcm2835_camera); vchiq_debugfs_deinit(); device_destroy(vchiq_class, vchiq_devid); class_destroy(vchiq_class);