summaryrefslogtreecommitdiffstats
path: root/drivers/mailbox
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mailbox')
-rw-r--r--drivers/mailbox/mailbox-test.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/mailbox/mailbox-test.c b/drivers/mailbox/mailbox-test.c
index dc11bbf27274..5f4b439fd45a 100644
--- a/drivers/mailbox/mailbox-test.c
+++ b/drivers/mailbox/mailbox-test.c
@@ -46,7 +46,6 @@ static ssize_t mbox_test_signal_write(struct file *filp,
46 size_t count, loff_t *ppos) 46 size_t count, loff_t *ppos)
47{ 47{
48 struct mbox_test_device *tdev = filp->private_data; 48 struct mbox_test_device *tdev = filp->private_data;
49 int ret;
50 49
51 if (!tdev->tx_channel) { 50 if (!tdev->tx_channel) {
52 dev_err(tdev->dev, "Channel cannot do Tx\n"); 51 dev_err(tdev->dev, "Channel cannot do Tx\n");
@@ -64,13 +63,13 @@ static ssize_t mbox_test_signal_write(struct file *filp,
64 if (!tdev->signal) 63 if (!tdev->signal)
65 return -ENOMEM; 64 return -ENOMEM;
66 65
67 ret = copy_from_user(tdev->signal, userbuf, count); 66 if (copy_from_user(tdev->signal, userbuf, count)) {
68 if (ret) {
69 kfree(tdev->signal); 67 kfree(tdev->signal);
68 tdev->signal = NULL;
70 return -EFAULT; 69 return -EFAULT;
71 } 70 }
72 71
73 return ret < 0 ? ret : count; 72 return count;
74} 73}
75 74
76static const struct file_operations mbox_test_signal_ops = { 75static const struct file_operations mbox_test_signal_ops = {