From patchwork Tue Oct 23 05:08:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 193353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-yh0-f56.google.com (mail-yh0-f56.google.com [209.85.213.56]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 79AFA2C0189 for ; Tue, 23 Oct 2012 16:08:45 +1100 (EST) Received: by mail-yh0-f56.google.com with SMTP id j63sf2951297yhj.11 for ; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-beenthere:received-spf:mime-version:date:message-id:subject:from :to:cc:x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type; bh=d21Ix80EMW56DrTnMceNK0mdLky9bPtdf14Up6oc5/4=; b=ezlWenQtgOHL/T/S+fDjG64i8SghjK7FnNt00FmEurNi/lII2uJJFSP+h6rbBicbRQ x7pb8J+GdkUgqsImzJo51wKOzU/9vtdzGJojeqHaKJdvZjz5cyBtUAnrLVA5Vv3GnvB/ qMSfcocCBFo3xehjKfvMGNxKOJwsFvZXK9FO/WtrAm5434/NzajthVZRFzGlvbRRVVFZ IfLj16Yxd5cUqcwDvkBCEbX/1GZbWisWjEYVMYrXMdsT7bC1aRAtSTveb/pEMQzDKD0q vEbnd9hapdAVQs7H+P0+4CBVhCFH+6L3tkNqnC51wrxfoGrBufCM919HfMgMxvwEpz7Y QPhQ== Received: by 10.224.209.137 with SMTP id gg9mr2352546qab.14.1350968922524; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.224.44.129 with SMTP id a1ls221457qaf.1.gmail; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) Received: by 10.224.189.75 with SMTP id dd11mr7076632qab.6.1350968922085; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) Received: by 10.224.189.75 with SMTP id dd11mr7076631qab.6.1350968922075; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) Received: from mail-qc0-f173.google.com (mail-qc0-f173.google.com [209.85.216.173]) by gmr-mx.google.com with ESMTPS id ba11si543512qcb.2.2012.10.22.22.08.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 22 Oct 2012 22:08:42 -0700 (PDT) Received-SPF: pass (google.com: domain of weiyj.lk@gmail.com designates 209.85.216.173 as permitted sender) client-ip=209.85.216.173; Received: by mail-qc0-f173.google.com with SMTP id b12so2521835qca.32 for ; Mon, 22 Oct 2012 22:08:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.17.70 with SMTP id r6mr5181332qaa.8.1350968921953; Mon, 22 Oct 2012 22:08:41 -0700 (PDT) Received: by 10.229.134.205 with HTTP; Mon, 22 Oct 2012 22:08:41 -0700 (PDT) Date: Tue, 23 Oct 2012 13:08:41 +0800 Message-ID: Subject: [rtc-linux] [PATCH] rtc: avoid calling platform_device_put() twice in test_init() From: Wei Yongjun To: a.zummo@towertech.it Cc: yongjun_wei@trendmicro.com.cn, rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org X-Original-Sender: weiyj.lk@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of weiyj.lk@gmail.com designates 209.85.216.173 as permitted sender) smtp.mail=weiyj.lk@gmail.com; dkim=pass header.i=@gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , From: Wei Yongjun In case of error, the function test_init() need to call platform_device_del() instead of platform_device_unregister(). Otherwise, we may call platform_device_put() twice. dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch) Signed-off-by: Wei Yongjun --- drivers/rtc/rtc-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index 7e96254..209a127 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c @@ -164,7 +164,7 @@ static int __init test_init(void) return 0; exit_device_unregister: - platform_device_unregister(test0); + platform_device_del(test0); exit_free_test1: platform_device_put(test1);