From patchwork Fri Sep 3 01:32:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 151821 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 o831SB5v031740 for ; Fri, 3 Sep 2010 01:28:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751891Ab0ICB2L (ORCPT ); Thu, 2 Sep 2010 21:28:11 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:46494 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281Ab0ICB2K (ORCPT ); Thu, 2 Sep 2010 21:28:10 -0400 Received: by vws3 with SMTP id 3so863545vws.19 for ; Thu, 02 Sep 2010 18:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=sAF49gG1Y9agbR6XV8XaYjXCh048HycJq3g1//gO7LE=; b=h9zIFAzRjHrOOK+C3oiKVyBQp2KS0G1clcGgHCDULiAu8Q3iRM0tBhqA3HH44WnKy9 +hOQVqlmAdj9PtmiLZkfYn1MeRYUx3SNIayu/LAxhuTn25pqyKOr9/4f8FupHJHSos2q 60YaiPtUL3XoBsa1GElNSdTyew4+MQXouCJFI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=IoQy/BDgsNX6Lk5m6v99F8Wt4Sv/aTZd3s640ZhohZph+YTI9Wjh6+gq2P63MG0z2x xLvNEkYD0r8U5AsCjFWoTd3yjxUdPpSPxa/x2yatf1xwdIgSbWXyRPYvqG1hRQEDcp8B l6taXnPAgxaMNsDq+c/xgWbqFOoyIw/pYd6qk= Received: by 10.220.61.140 with SMTP id t12mr122562vch.54.1283477288706; Thu, 02 Sep 2010 18:28:08 -0700 (PDT) Received: from [192.168.100.50] (60-251-136-127.HINET-IP.hinet.net [60.251.136.127]) by mx.google.com with ESMTPS id l5sm518143vch.5.2010.09.02.18.28.06 (version=SSLv3 cipher=RC4-MD5); Thu, 02 Sep 2010 18:28:08 -0700 (PDT) Subject: [PATCH 2/2] Input: stmpe-ts - return -ENOMEM if memory allocation fail From: Axel Lin To: linux-kernel Cc: Luotao Fu , Dmitry Torokhov , linux-input@vger.kernel.org In-Reply-To: <1283477451.5439.6.camel@mola> References: <1283477451.5439.6.camel@mola> Date: Fri, 03 Sep 2010 09:32:13 +0800 Message-Id: <1283477533.5439.8.camel@mola> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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]); Fri, 03 Sep 2010 01:28:12 +0000 (UTC) diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index 0339d1d..e715b27 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -276,12 +276,16 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) return ts_irq; ts = kzalloc(sizeof(*ts), GFP_KERNEL); - if (!ts) + if (!ts) { + ret = -ENOMEM; goto err_out; + } idev = input_allocate_device(); - if (!idev) + if (!idev) { + ret = -ENOMEM; goto err_free_ts; + } platform_set_drvdata(pdev, ts); ts->stmpe = stmpe;