diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2012-09-17 04:04:57 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-22 16:46:56 -0200 |
commit | 6c17c24d384ce69893e191c94b500c97bd263c27 (patch) | |
tree | 7633c9c5116e247f5c897fbb34cedb84a634311b /drivers/media/pci | |
parent | c81d497284f6009a856b399e70f812671fdc7fcf (diff) | |
download | linux-6c17c24d384ce69893e191c94b500c97bd263c27.tar.gz linux-6c17c24d384ce69893e191c94b500c97bd263c27.tar.bz2 linux-6c17c24d384ce69893e191c94b500c97bd263c27.zip |
[media] cx25821: Replace kmemdup for kstrdup and clean up
Replace kmemdup for kstrdup and cleanup related code.
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/cx25821/cx25821-audio-upstream.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c index 42ad84a68542..87491ca05ee5 100644 --- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c +++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c @@ -701,7 +701,6 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) { struct sram_channel *sram_ch; int err = 0; - int str_length = 0; if (dev->_audio_is_running) { pr_warn("Audio Channel is still running so return!\n"); @@ -730,9 +729,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) _line_size = AUDIO_LINE_SIZE; if (dev->input_audiofilename) { - str_length = strlen(dev->input_audiofilename); - dev->_audiofilename = kmemdup(dev->input_audiofilename, - str_length + 1, GFP_KERNEL); + dev->_audiofilename = kstrdup(dev->input_audiofilename, + GFP_KERNEL); if (!dev->_audiofilename) { err = -ENOMEM; @@ -743,9 +741,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) if (strcmp(dev->input_audiofilename, "") == 0) dev->_audiofilename = "/root/audioGOOD.wav"; } else { - str_length = strlen(_defaultAudioName); - dev->_audiofilename = kmemdup(_defaultAudioName, - str_length + 1, GFP_KERNEL); + dev->_audiofilename = kstrdup(_defaultAudioName, + GFP_KERNEL); if (!dev->_audiofilename) { err = -ENOMEM; |