From patchwork Wed Oct 13 07:17:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 249791 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9D7FVqw032659 for ; Wed, 13 Oct 2010 07:15:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752997Ab0JMHP3 (ORCPT ); Wed, 13 Oct 2010 03:15:29 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:64835 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954Ab0JMHP2 (ORCPT ); Wed, 13 Oct 2010 03:15:28 -0400 Received: by pvc7 with SMTP id 7so290312pvc.19 for ; Wed, 13 Oct 2010 00:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=QvtRfPaHx7mrCP7Yo36mX9LhlixiC5JdvYLrHHeDZkQ=; b=BeJq2egKJMbUuUaWg+kNxCik6eVB4AYWvK0hs2SGjaXTOJKZuq/RecKC9/0C2kbo3I zTizxj2MaR11GhcwmJ26ufuqEnJLNj006DAGmqWPgB9Z4mZUETqEQqbLqpKXzveGfxXe RIYIoWSRY1QYHVgBIWqDGJkg8PVOfvpgPeDkk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=nUWSTKny1QTvt8fniTox/RiuIsZ0bnnOmgfNOwkMKeiolBzKx4/S2kJ8LhFksJjL/y N7+MPC7ej0agptmlobPSAiC0YibIzt5HU12HGAA9L6Y0LoJD8AE/f5gMWoB7gxjY/u48 S5+UvZpb0nE8RXQ6EfZ9dn01yKZq6QZZr1lgc= Received: by 10.142.202.3 with SMTP id z3mr7243991wff.275.1286954128504; Wed, 13 Oct 2010 00:15:28 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id e14sm4430619wfg.8.2010.10.13.00.15.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 00:15:27 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, g.liakhovetski@gmx.de Date: Wed, 13 Oct 2010 16:17:45 +0900 Message-Id: <20101013071745.19716.66656.sendpatchset@t400s> Subject: [PATCH] sh: free-without-alloc fix for sh_mobile_lcdcfb Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Oct 2010 07:15:31 +0000 (UTC) --- 0001/drivers/video/sh_mobile_lcdcfb.c +++ work/drivers/video/sh_mobile_lcdcfb.c 2010-10-07 18:36:45.000000000 +0900 @@ -1324,8 +1324,10 @@ static int sh_mobile_lcdc_remove(struct if (priv->ch[i].sglist) vfree(priv->ch[i].sglist); - dma_free_coherent(&pdev->dev, info->fix.smem_len, - info->screen_base, priv->ch[i].dma_handle); + if (info->screen_base) + dma_free_coherent(&pdev->dev, info->fix.smem_len, + info->screen_base, + priv->ch[i].dma_handle); fb_dealloc_cmap(&info->cmap); framebuffer_release(info); }