diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2012-09-17 03:04:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-11-22 13:46:56 -0500 |
commit | 6c17c24d384ce69893e191c94b500c97bd263c27 (patch) | |
tree | 7633c9c5116e247f5c897fbb34cedb84a634311b /drivers/media/pci | |
parent | c81d497284f6009a856b399e70f812671fdc7fcf (diff) |
[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) | |||
701 | { | 701 | { |
702 | struct sram_channel *sram_ch; | 702 | struct sram_channel *sram_ch; |
703 | int err = 0; | 703 | int err = 0; |
704 | int str_length = 0; | ||
705 | 704 | ||
706 | if (dev->_audio_is_running) { | 705 | if (dev->_audio_is_running) { |
707 | pr_warn("Audio Channel is still running so return!\n"); | 706 | 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) | |||
730 | _line_size = AUDIO_LINE_SIZE; | 729 | _line_size = AUDIO_LINE_SIZE; |
731 | 730 | ||
732 | if (dev->input_audiofilename) { | 731 | if (dev->input_audiofilename) { |
733 | str_length = strlen(dev->input_audiofilename); | 732 | dev->_audiofilename = kstrdup(dev->input_audiofilename, |
734 | dev->_audiofilename = kmemdup(dev->input_audiofilename, | 733 | GFP_KERNEL); |
735 | str_length + 1, GFP_KERNEL); | ||
736 | 734 | ||
737 | if (!dev->_audiofilename) { | 735 | if (!dev->_audiofilename) { |
738 | err = -ENOMEM; | 736 | err = -ENOMEM; |
@@ -743,9 +741,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) | |||
743 | if (strcmp(dev->input_audiofilename, "") == 0) | 741 | if (strcmp(dev->input_audiofilename, "") == 0) |
744 | dev->_audiofilename = "/root/audioGOOD.wav"; | 742 | dev->_audiofilename = "/root/audioGOOD.wav"; |
745 | } else { | 743 | } else { |
746 | str_length = strlen(_defaultAudioName); | 744 | dev->_audiofilename = kstrdup(_defaultAudioName, |
747 | dev->_audiofilename = kmemdup(_defaultAudioName, | 745 | GFP_KERNEL); |
748 | str_length + 1, GFP_KERNEL); | ||
749 | 746 | ||
750 | if (!dev->_audiofilename) { | 747 | if (!dev->_audiofilename) { |
751 | err = -ENOMEM; | 748 | err = -ENOMEM; |