summaryrefslogtreecommitdiff
path: root/include/media/media-devnode.h
diff options
context:
space:
mode:
authorPeter Senna Tschudin <peter.senna@gmail.com>2012-09-17 07:04:58 (GMT)
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-18 23:37:09 (GMT)
commitcab3e1ffbe1b9c7a607506338f590dc1e6ca9909 (patch)
tree279b698e61b2d54534235c6c401ddfc755cf560f /include/media/media-devnode.h
parent52dee392f491e166cef21c787d1736f052a902cd (diff)
downloadlinux-fsl-qoriq-cab3e1ffbe1b9c7a607506338f590dc1e6ca9909.tar.xz
[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>
Diffstat (limited to 'include/media/media-devnode.h')
0 files changed, 0 insertions, 0 deletions