From patchwork Mon Jun 16 14:39:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=BCrg_Billeter?= X-Patchwork-Id: 4360431 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D99E1BEEAA for ; Mon, 16 Jun 2014 15:33:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1786720279 for ; Mon, 16 Jun 2014 15:33:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 133932020A for ; Mon, 16 Jun 2014 15:33:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755350AbaFPPd3 (ORCPT ); Mon, 16 Jun 2014 11:33:29 -0400 Received: from cpanel09.rubas.ch ([195.182.222.79]:57360 "EHLO cpanel09.rubas.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbaFPPd3 (ORCPT ); Mon, 16 Jun 2014 11:33:29 -0400 X-Greylist: delayed 3185 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Jun 2014 11:33:28 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bitron.ch; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject:Cc:To:From; bh=2OT5aS79j1rXtqQzxJNXKwI7YIFoBoUvz+rz89CPpns=; b=OeG1JVSAoPB0HpCT3h7waWkGeuJCsdRgakUVbA5IWu0/c9ogjzcscEF5CPBx8aR9fAjDMMrggShsWmzoEX4aYne1CUU5BiyNtNYSM0+PmXrcQT0lR7Llnh26NRrMcfP6; Received: from 46-127-237-10.dynamic.hispeed.ch ([46.127.237.10]:41247 helo=jivy.bitron.ch) by cpanel09.rubas.ch with esmtpsa (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from ) id 1WwY52-000SYN-G7; Mon, 16 Jun 2014 16:40:16 +0200 From: =?UTF-8?q?J=C3=BCrg=20Billeter?= To: Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?J=C3=BCrg=20Billeter?= Subject: [PATCH] spi: sh-sci: fix use-after-free in sh_sci_spi_remove() Date: Mon, 16 Jun 2014 16:39:29 +0200 Message-Id: <1402929569-14500-1-git-send-email-j@bitron.ch> X-Mailer: git-send-email 2.0.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel09.rubas.ch X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - bitron.ch X-Get-Message-Sender-Via: cpanel09.rubas.ch: authenticated_id: juerg@bitron.ch Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP setbits() uses sp->membase. Signed-off-by: Jürg Billeter Acked-by: Geert Uytterhoeven --- drivers/spi/spi-sh-sci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c index 1f56ef6..b83dd73 100644 --- a/drivers/spi/spi-sh-sci.c +++ b/drivers/spi/spi-sh-sci.c @@ -175,9 +175,9 @@ static int sh_sci_spi_remove(struct platform_device *dev) { struct sh_sci_spi *sp = platform_get_drvdata(dev); - iounmap(sp->membase); - setbits(sp, PIN_INIT, 0); spi_bitbang_stop(&sp->bitbang); + setbits(sp, PIN_INIT, 0); + iounmap(sp->membase); spi_master_put(sp->bitbang.master); return 0; }