linux/drivers/media/pci
Peter Senna Tschudin cab3e1ffbe [media] cx25821: Cleanup filename assignment code
I'm pasting the original code and my proposal on the commit message for
make it easy to compare the two versions.
Line 62 of cx25821-audio-upstream.h contains:
char *_defaultAudioName = "/root/audioGOOD.wav";
Original code after replace kmemdup for kstrdup, and after fix return error
code:
if (dev->input_audiofilename) {
	dev->_audiofilename = kstrdup(dev->input_audiofilename,
				      GFP_KERNEL);
	if (!dev->_audiofilename) {
		err = -ENOMEM;
		goto error;
	}
	/* Default if filename is empty string */
	if (strcmp(dev->input_audiofilename, "") == 0)
		dev->_audiofilename = "/root/audioGOOD.wav";
} else {
	dev->_audiofilename = kstrdup(_defaultAudioName,
				      GFP_KERNEL);
	if (!dev->_audiofilename) {
		err = -ENOMEM;
		goto error;
	}
}
Code proposed in this patch:
if ((dev->input_audiofilename) &&
    (strcmp(dev->input_audiofilename, "") != 0))
	dev->_audiofilename = kstrdup(dev->input_audiofilename,
				      GFP_KERNEL);
else
	dev->_audiofilename = kstrdup(_defaultAudioName,
				      GFP_KERNEL);
if (!dev->_audiofilename) {
	err = -ENOMEM;
	goto error;
}

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-03-18 20:37:09 -03:00
..
b2c2
bt8xx [media] bttv: move fini_bttv_i2c() from bttv-input.c to bttv-i2c.c 2013-03-05 17:11:12 -03:00
cx18 [media] cx18/ivtv: fix regression: remove __init from a non-init function 2013-02-11 18:18:14 -02:00
cx88 [media] btcx-risc: move from media/i2c to media/common 2013-02-08 16:11:25 -02:00
cx23885 [media] btcx-risc: move from media/i2c to media/common 2013-02-08 16:11:25 -02:00
cx25821 [media] cx25821: Cleanup filename assignment code 2013-03-18 20:37:09 -03:00
ddbridge Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
dm1105 Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
ivtv [media] media: ivtv: Remove redundant NULL check before kfree 2013-03-18 17:04:37 -03:00
mantis Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
meye [media] meye: convert to the control framework 2013-02-05 18:23:47 -02:00
ngene Merge branch 'v4l_for_linus' into staging/for_v3.9 2013-01-24 18:49:18 -02:00
pluto2 Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
pt1 Drivers: media: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
saa7134 [media] saa7134: Add capture card Hawell HW-9004V1 2013-02-08 14:50:33 -02:00
saa7146
saa7164 [media] saa7164: silence GCC warnings 2013-02-05 13:50:14 -02:00
sta2x11 [media] sta2x11_vip: convert to videobuf2, control framework, file handler 2013-02-06 14:17:17 -02:00
ttpci [media] [V2,03/24] pci/ttpci/av7110.c: use IS_ENABLED() macro 2013-02-06 09:19:43 -02:00
zoran Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
Kconfig
Makefile