aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2011-08-25 08:43:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-09-06 13:39:10 -0400
commiteb70ac1b1e457537a056cb714ccddbb1fd56f9ed (patch)
treead599b0b767cbefd1f08d75a382c237c63d3726f /drivers/media/radio
parentf68afe5d45198bfe7040cf751033c6208577468c (diff)
[media] wl128x: fix compiler warning + wrong write() return
The fix is to check for ret and return -EFAULT if non-zero. I also noticed that write() didn't return the number of bytes written. Fixed as well. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/wl128x/fmdrv_v4l2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c
index 8c0e19276970..478d1e93ada6 100644
--- a/drivers/media/radio/wl128x/fmdrv_v4l2.c
+++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c
@@ -84,12 +84,14 @@ static ssize_t fm_v4l2_fops_write(struct file *file, const char __user * buf,
84 ret = copy_from_user(&rds, buf, sizeof(rds)); 84 ret = copy_from_user(&rds, buf, sizeof(rds));
85 fmdbg("(%d)type: %d, text %s, af %d\n", 85 fmdbg("(%d)type: %d, text %s, af %d\n",
86 ret, rds.text_type, rds.text, rds.af_freq); 86 ret, rds.text_type, rds.text, rds.af_freq);
87 if (ret)
88 return -EFAULT;
87 89
88 fmdev = video_drvdata(file); 90 fmdev = video_drvdata(file);
89 fm_tx_set_radio_text(fmdev, rds.text, rds.text_type); 91 fm_tx_set_radio_text(fmdev, rds.text, rds.text_type);
90 fm_tx_set_af(fmdev, rds.af_freq); 92 fm_tx_set_af(fmdev, rds.af_freq);
91 93
92 return 0; 94 return sizeof(rds);
93} 95}
94 96
95static u32 fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *pts) 97static u32 fm_v4l2_fops_poll(struct file *file, struct poll_table_struct *pts)