diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 2ec60f8d2777f1538293f69a5d95460ebf63d38a..64481289c98e776b07dd50cf6345ea7be9d798f3 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1090,7 +1090,7 @@ static ssize_t store_filter(struct device *device,
 
 unlock:
 	mutex_unlock(&dev->lock);
-	return count;
+	return (ret < 0) ? ret : count;
 }
 
 static void rc_dev_release(struct device *device)