From patchwork Thu May 26 08:55:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 820192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4Q8tblw019636 for ; Thu, 26 May 2011 08:55:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756961Ab1EZIze (ORCPT ); Thu, 26 May 2011 04:55:34 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:42931 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756243Ab1EZIzd (ORCPT ); Thu, 26 May 2011 04:55:33 -0400 Received: by bwz15 with SMTP id 15so256967bwz.19 for ; Thu, 26 May 2011 01:55:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=2cuXoRfpH7en/tr99a7REuJ3S8D/EPxX/x1sYMJaw8I=; b=w9MPE7XTtel3NEvACgvve9A14PFlF5j3DiRhtP0gc4Uuu9xC/kvwujgCVdtW600pJp Nxj9Hhjs4ypB8WSEAI1MNcS9jj4JocLl1Ks0v9dlS/SjbW2hahGsAAg4XVNGEUjDV8IC ysgX1pbdZKPvPFNoVsXE8MMbUDXAglVf/TVQc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=pCQNB/W4caQP6po6zalXU674RSQgPsgrdwslEHv32RZc6ERSfXzd4dmw35YZZmzAt3 xixX3JoSNmHjaWlLUbAblf32wzn0fys97mG6v62t+OOAJ0rJ81OSm9wSJEWSngzbKveH bg21q1l69cj0wZww/BtifJErEIilgFCu0Hyo4= Received: by 10.204.20.139 with SMTP id f11mr400637bkb.177.1306400132435; Thu, 26 May 2011 01:55:32 -0700 (PDT) Received: from shale.localdomain ([212.49.88.34]) by mx.google.com with ESMTPS id k10sm284201bkq.10.2011.05.26.01.55.28 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 01:55:31 -0700 (PDT) Date: Thu, 26 May 2011 11:55:08 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Jarod Wilson , "open list:MEDIA INPUT INFRA..." , kernel-janitors@vger.kernel.org Subject: [patch] [media] rc/redrat3: dereferencing null pointer Message-ID: <20110526085508.GG14591@shale.localdomain> 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]); Thu, 26 May 2011 08:55:37 +0000 (UTC) In the original code, if the allocation failed we dereference "rr3" when it was NULL. Signed-off-by: Dan Carpenter Acked-by: Jarod Wilson --- 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/rc/redrat3.c b/drivers/media/rc/redrat3.c index 5147767..4582ef7 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -1186,7 +1186,7 @@ static int __devinit redrat3_dev_probe(struct usb_interface *intf, rr3 = kzalloc(sizeof(*rr3), GFP_KERNEL); if (rr3 == NULL) { dev_err(dev, "Memory allocation failure\n"); - goto error; + goto no_endpoints; } rr3->dev = &intf->dev;