diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-06 16:11:57 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-06 16:11:57 -0700 |
commit | 28b8383d5d4d9b636c3734c993563bafdc2ab3c3 (patch) | |
tree | 95fd3fc6e12cdca5cbf999595273bda9ae104922 /drivers/media/video | |
parent | c28cf0fdcd38e912fa72258d78cb213b716247d6 (diff) | |
parent | a80c5aa6da485da63def31442a19cdd6ff495ce6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
V4L/DVB (7499): v4l/dvb Kconfig: Fix bugzilla #10067
V4L/DVB (7495): s5h1409: fix blown-away bit in function s5h1409_set_gpio
V4L/DVB (7460): bttv: Bt832 - fix possible NULL pointer deref
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/bt8xx/bt832.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/video/bt8xx/bt832.c b/drivers/media/video/bt8xx/bt832.c index a51876137880..f92f06dec0d0 100644 --- a/drivers/media/video/bt8xx/bt832.c +++ b/drivers/media/video/bt8xx/bt832.c @@ -97,6 +97,11 @@ int bt832_init(struct i2c_client *i2c_client_s) int rc; buf=kmalloc(65,GFP_KERNEL); + if (!buf) { + v4l_err(&t->client, + "Unable to allocate memory. Detaching.\n"); + return 0; + } bt832_hexdump(i2c_client_s,buf); if(buf[0x40] != 0x31) { @@ -211,7 +216,12 @@ bt832_command(struct i2c_client *client, unsigned int cmd, void *arg) switch (cmd) { case BT832_HEXDUMP: { unsigned char *buf; - buf=kmalloc(65,GFP_KERNEL); + buf = kmalloc(65, GFP_KERNEL); + if (!buf) { + v4l_err(&t->client, + "Unable to allocate memory\n"); + break; + } bt832_hexdump(&t->client,buf); kfree(buf); } |