From patchwork Fri Sep 18 23:11:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 48688 X-Patchwork-Delegate: dougsland@redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8IN4JHR025743 for ; Fri, 18 Sep 2009 23:04:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758821AbZIRXEP (ORCPT ); Fri, 18 Sep 2009 19:04:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758794AbZIRXEP (ORCPT ); Fri, 18 Sep 2009 19:04:15 -0400 Received: from mail-ew0-f206.google.com ([209.85.219.206]:55605 "EHLO mail-ew0-f206.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758744AbZIRXEO (ORCPT ); Fri, 18 Sep 2009 19:04:14 -0400 Received: by ewy2 with SMTP id 2so1730409ewy.17 for ; Fri, 18 Sep 2009 16:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=CDIG+mjorM2YMvHW9AbyvdBmqEI8yT9uyOltKYreuY4=; b=bD7EmV6DoGAakXNQ5JXjxzXQtsqwBAjUALvyjxsoR095JHLimbQU93Roi2W5k/SQPP Zgz5b1adiE1cD5dinZcwJJ73oUmcdpgKnnOLg9L0z9w9VuKKOvJokS0p5Tjpg7vxOe0M TTnlWHwOYk7RuhUZzvHY2nDRAsw3WnzWbgrUQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=FPvruNfKOGZyQeIMxmLdbyBqBtq/IdRwLA9iCtEnj5Ny8W0vkRcj8iGUHrvQOC4lF5 x36o5EhGoXC35/ehrLsYHq2FQL6J8BzGgyOWZ1DiQ+rJZ/kaEqyK/+myWV5W9bpwfllR lQ+f/ecgvfAd2LLUCSxs5+TmYlFBGArnsBsDQ= Received: by 10.211.131.19 with SMTP id i19mr2684836ebn.34.1253315057159; Fri, 18 Sep 2009 16:04:17 -0700 (PDT) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 7sm1378634eyb.36.2009.09.18.16.04.16 (version=SSLv3 cipher=RC4-MD5); Fri, 18 Sep 2009 16:04:16 -0700 (PDT) Message-ID: <4AB413A1.3070306@gmail.com> Date: Sat, 19 Sep 2009 01:11:29 +0200 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Thunderbird/3.0b3 MIME-Version: 1.0 To: Mauro Carvalho Chehab , linux-media@vger.kernel.org, Andrew Morton Subject: [PATCH] V4L/DVB (11380): kzalloc failure ignored in au8522_probe() Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Prevent NULL dereference if kzalloc() fails. Signed-off-by: Roel Kluin --- Found with sed: http://kernelnewbies.org/roelkluin Build tested. -- 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/au8522_decoder.c b/drivers/media/dvb/frontends/au8522_decoder.c index 9e9a755..74981ee 100644 --- a/drivers/media/dvb/frontends/au8522_decoder.c +++ b/drivers/media/dvb/frontends/au8522_decoder.c @@ -792,6 +792,11 @@ static int au8522_probe(struct i2c_client *client, } demod_config = kzalloc(sizeof(struct au8522_config), GFP_KERNEL); + if (demod_config == NULL) { + if (instance == 1) + kfree(state); + return -ENOMEM; + } demod_config->demod_address = 0x8e >> 1; state->config = demod_config;