From patchwork Sat Aug 6 08:00:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1041082 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7680rk7018716 for ; Sat, 6 Aug 2011 08:00:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030Ab1HFIAn (ORCPT ); Sat, 6 Aug 2011 04:00:43 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:40481 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750892Ab1HFIAm (ORCPT ); Sat, 6 Aug 2011 04:00:42 -0400 Received: by fxh19 with SMTP id 19so3547756fxh.19 for ; Sat, 06 Aug 2011 01:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=4KCAfCvKOsvZgESO8tKF38AYtBoP8isimpxtfFUM4Ig=; b=HG/zlGKMsNj4lIwXV1oWX3RaQHMQhJ1ZziRvBnQP7yKOfNVeoxTk8SXugheTADK4PJ +W/qLiqalUNtLAlcI9eESWLDrdcTtu17Msn+c3FFRj5Btc7/V7Kut0NrRJo0ZBAGd7Vk XLSPmiAz1w+rSfjfiPo82I3B2o7hD1bkfLGNU= Received: by 10.223.91.147 with SMTP id n19mr3295748fam.53.1312617641025; Sat, 06 Aug 2011 01:00:41 -0700 (PDT) Received: from mwanda ([212.49.88.34]) by mx.google.com with ESMTPS id x2sm2508933fal.44.2011.08.06.01.00.34 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 06 Aug 2011 01:00:39 -0700 (PDT) Date: Sat, 6 Aug 2011 01:00:34 -0700 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Patrick Boettcher , Olivier Grenie , Devin Heitmueller , "open list:MEDIA INPUT INFRA..." , kernel-janitors@vger.kernel.org Subject: [patch] [media] dib7000p: return error code on allocation failure Message-ID: <20110806080033.GA28348@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 06 Aug 2011 08:00:54 +0000 (UTC) The goto needs to be moved after the assignment. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/dvb/frontends/dib7000p.c b/drivers/media/dvb/frontends/dib7000p.c index a64a538..9c40267 100644 --- a/drivers/media/dvb/frontends/dib7000p.c +++ b/drivers/media/dvb/frontends/dib7000p.c @@ -1577,8 +1577,8 @@ int dib7000pc_detection(struct i2c_adapter *i2c_adap) return -ENOMEM; rx = kzalloc(2*sizeof(u8), GFP_KERNEL); if (!rx) { - goto rx_memory_error; ret = -ENOMEM; + goto rx_memory_error; } msg[0].buf = tx;