From patchwork Sun Sep 5 03:10:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 156401 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 o853AF2n031773 for ; Sun, 5 Sep 2010 03:10:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778Ab0IEDKO (ORCPT ); Sat, 4 Sep 2010 23:10:14 -0400 Received: from mail-pw0-f46.google.com ([209.85.160.46]:58465 "EHLO mail-pw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750841Ab0IEDKN (ORCPT ); Sat, 4 Sep 2010 23:10:13 -0400 Received: by pwi3 with SMTP id 3so679626pwi.19 for ; Sat, 04 Sep 2010 20:10:13 -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 :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=lQXwVa52qYYAfVsd2Udy5culcU2bQ2N0dBfkfItFuCI=; b=FO608i7aJepZvAo4Kt6JeNn2ZAcgY8VEffb2DGWx65tn87RmlN8yrYfU04qC/EAYT/ nvZmzw/M0Ie6INUi1Zlcow+o7CvXpB9NDIlHp5iltu1Jn7PBhqjFwoOylZa7tyy6BjJN 9MhtWPXphaMsyMAWWY4vyXAiRxTLvYmcsv4Jo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=inBSuUfgjHt1zUkTO6SJAOVT0WInXFF9D+wcpDMbEB8x98asEJd7lgp/HTOM10t69w rSGAUjOXrpU0M71dMWooTQvJPgedsZxJjHDj/vCoRzOa5WXUvRkOPQVyLjdBtySElcrB tFfoxAmiPuRNgRRXUXJF6tfgKfWNBTGl3MFXA= Received: by 10.114.110.16 with SMTP id i16mr1505771wac.208.1283656213059; Sat, 04 Sep 2010 20:10:13 -0700 (PDT) Received: from [218.167.78.53] (218-167-78-53.dynamic.hinet.net [218.167.78.53]) by mx.google.com with ESMTPS id k23sm7653559waf.17.2010.09.04.20.10.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 04 Sep 2010 20:10:12 -0700 (PDT) Subject: [PATCH 2/2 v2] Input: stmpe-ts - return -ENOMEM if memory allocation fail From: Axel Lin To: linux-kernel Cc: Dmitry Torokhov , Wolfram Sang , Luotao Fu , linux-input@vger.kernel.org Date: Sun, 05 Sep 2010 11:10:44 +0800 Message-ID: <1283656244.8339.3.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 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]); Sun, 05 Sep 2010 03:10:42 +0000 (UTC) diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c index 656148e..06869e4 100644 --- a/drivers/input/touchscreen/stmpe-ts.c +++ b/drivers/input/touchscreen/stmpe-ts.c @@ -268,7 +268,7 @@ static int __devinit stmpe_input_probe(struct platform_device *pdev) struct stmpe_touch *ts; struct input_dev *idev; struct stmpe_ts_platform_data *ts_pdata = NULL; - int ret = 0; + int ret; int ts_irq; ts_irq = platform_get_irq_byname(pdev, "FIFO_TH"); @@ -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;