public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manu Abraham <abraham.manu@gmail.com>
To: Greg KH <greg@kroah.com>
Cc: Amit Choudhary <amit2030@gmail.com>,
	v4l-dvb maintainer list <v4l-dvb-maintainer@linuxtv.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	stable@kernel.org
Subject: Re: [stable] [PATCH 2.6.19-rc1] drivers/media/dvb/bt8xx/dvb-bt8xx.c: check kmalloc() return value.
Date: Tue, 10 Oct 2006 15:18:58 +0400	[thread overview]
Message-ID: <452B81A2.6060905@gmail.com> (raw)
In-Reply-To: <20061010080110.GA20169@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 1165 bytes --]

Greg KH wrote:
> On Mon, Oct 09, 2006 at 12:34:41PM +0400, Manu Abraham wrote:
>> Amit Choudhary wrote:
>>> Description: Check the return value of kmalloc() in function frontend_init(), in file drivers/media/dvb/bt8xx/dvb-bt8xx.c.
>>>
>>> Signed-off-by: Amit Choudhary <amit2030@gmail.com>
>>>
>>> diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
>>> index fb6c4cc..14e69a7 100644
>>> --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c
>>> +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c
>>> @@ -665,6 +665,10 @@ static void frontend_init(struct dvb_bt8
>>>  	case BTTV_BOARD_TWINHAN_DST:
>>>  		/*	DST is not a frontend driver !!!		*/
>>>  		state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL);
>>> +		if (!state) {
>>> +			printk("dvb_bt8xx: No memory\n");
>>> +			break;
>>> +		}
>>>  		/*	Setup the Card					*/
>>>  		state->config = &dst_config;
>>>  		state->i2c = card->i2c_adapter;
>>> -
>>
>> Signed-off-by: Manu Abraham <manu@linuxtv.org>
> 
> Care to send the full patch in a format that we can apply it to the
> -stable tree?
> 


 dvb-bt8xx.c |    4 ++++
 1 files changed, 4 insertions(+)


Thanks,

Manu

[-- Attachment #2: dvb_check_mem_allocation.patch --]
[-- Type: text/x-patch, Size: 689 bytes --]

diff -Naurp linux-2.6.18.orig/drivers/media/dvb/bt8xx/dvb-bt8xx.c linux-2.6.18/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- linux-2.6.18.orig/drivers/media/dvb/bt8xx/dvb-bt8xx.c	2006-09-20 07:42:06.000000000 +0400
+++ linux-2.6.18/drivers/media/dvb/bt8xx/dvb-bt8xx.c	2006-10-10 15:02:28.000000000 +0400
@@ -666,6 +666,10 @@ static void frontend_init(struct dvb_bt8
 	case BTTV_BOARD_TWINHAN_DST:
 		/*	DST is not a frontend driver !!!		*/
 		state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL);
+		if (!state) {
+			printk("%s: Out of Memory !\n", __func__);
+			break;
+		}
 		/*	Setup the Card					*/
 		state->config = &dst_config;
 		state->i2c = card->i2c_adapter;

  reply	other threads:[~2006-10-10 11:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09  6:10 [PATCH 2.6.19-rc1] drivers/media/dvb/bt8xx/dvb-bt8xx.c: check kmalloc() return value Amit Choudhary
2006-10-09  8:34 ` Manu Abraham
2006-10-10  8:01   ` [stable] " Greg KH
2006-10-10 11:18     ` Manu Abraham [this message]
2006-10-10 16:31       ` Greg KH
2006-10-09  8:37 ` Olaf Hering
2006-10-09  8:44   ` Manu Abraham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=452B81A2.6060905@gmail.com \
    --to=abraham.manu@gmail.com \
    --cc=amit2030@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@kernel.org \
    --cc=v4l-dvb-maintainer@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox