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
..
2013-02-21 15:27:22 -08:00
2013-02-27 19:10:15 -08:00
2013-02-27 19:10:15 -08:00
2013-02-27 19:10:15 -08:00
2013-03-01 13:39:00 -08:00
2013-02-21 12:11:44 -08:00
2013-03-01 22:45:52 +00:00
2013-02-27 19:10:17 -08:00
2013-03-02 08:31:39 -08:00
2013-03-02 16:33:54 -08:00
2013-02-21 15:38:49 -08:00
2013-02-27 19:10:18 -08:00
2013-02-26 09:34:29 -08:00
2013-02-27 19:10:18 -08:00
2013-02-28 09:37:12 +01:00
2013-03-02 11:42:16 -08:00
2013-02-21 15:27:22 -08:00
2013-02-27 19:10:19 -08:00
2013-03-03 10:24:57 -08:00
2013-02-27 19:10:19 -08:00
2013-02-28 19:59:34 -08:00
2013-03-03 14:22:53 -08:00
2013-02-22 23:31:31 -05:00
2013-02-21 13:57:13 -08:00