From patchwork Sat Mar 26 01:52:22 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 665441 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 p2Q1r0S8000756 for ; Sat, 26 Mar 2011 01:53:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933591Ab1CZBw5 (ORCPT ); Fri, 25 Mar 2011 21:52:57 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:43264 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755665Ab1CZBw4 (ORCPT ); Fri, 25 Mar 2011 21:52:56 -0400 Received: by iwn34 with SMTP id 34so1649208iwn.19 for ; Fri, 25 Mar 2011 18:52:56 -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=viIiWzFPgc2oIwViusfXoKOPiUPPAJoi7zQ/L5z41LQ=; b=fdfmvJdnvzAakEDJ/LROjWHONXl7uoU5RjKkygSyKR2VcDERow9BGn3/SJvVXRy0vW A7WPYIiRjnnwbl5o3hSwvluuhB8tTKYat2flQkbtLjRbYXxBAOgUIaIu9MBZhdBqYBtB b6dfWdZsqNx83J0TX/IfZ3uKuG/7e71FYgGhU= 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=wDzFKZfrnKpVIDb7NNgXtk5+1p2k0kBaYnbtcbHmTawp5QX8nqmktolAPB95aqe616 3YAI++hvXH2ZM7Uik2+v3yZN6CHSjpcL4i25ZFLgOio0SMqsDe9JfEdm6WJJGqjkc2a6 FOdNlMONEaCfxNktWYJLil2HlDsc/RVK/oAkk= Received: by 10.42.159.201 with SMTP id m9mr2363938icx.244.1301104376251; Fri, 25 Mar 2011 18:52:56 -0700 (PDT) Received: from bicker ([212.49.88.34]) by mx.google.com with ESMTPS id u9sm1022656ibe.36.2011.03.25.18.52.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2011 18:52:55 -0700 (PDT) Date: Sat, 26 Mar 2011 04:52:22 +0300 From: Dan Carpenter To: Mike Isely Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 3/6] [media] pvrusb2: check for allocation failures Message-ID: <20110326015221.GH2008@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 (demeter1.kernel.org [140.211.167.41]); Sat, 26 Mar 2011 01:53:01 +0000 (UTC) diff --git a/drivers/media/video/pvrusb2/pvrusb2-std.c b/drivers/media/video/pvrusb2/pvrusb2-std.c index 370a9ab..b214f77 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-std.c +++ b/drivers/media/video/pvrusb2/pvrusb2-std.c @@ -388,6 +388,9 @@ struct v4l2_standard *pvr2_std_create_enum(unsigned int *countptr, stddefs = kzalloc(sizeof(struct v4l2_standard) * std_cnt, GFP_KERNEL); + if (!stddefs) + return NULL; + for (idx = 0; idx < std_cnt; idx++) stddefs[idx].index = idx;