From: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>

The return value of __rvin_try_format_source is not checked, add a check
and propagate the error.

Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
---
 drivers/media/platform/rcar-vin/rcar-v4l2.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c 
b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 6f1c27fc828fe57e..de71e5fa8b10cb5e 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -208,6 +208,7 @@ static int __rvin_try_format(struct rvin_dev *vin,
 {
        const struct rvin_video_format *info;
        u32 rwidth, rheight, walign;
+       int ret;
 
        /* Requested */
        rwidth = pix->width;
@@ -235,7 +236,9 @@ static int __rvin_try_format(struct rvin_dev *vin,
        pix->sizeimage = 0;
 
        /* Limit to source capabilities */
-       __rvin_try_format_source(vin, which, pix, source);
+       ret = __rvin_try_format_source(vin, which, pix, source);
+       if (ret)
+               return ret;
 
        switch (pix->field) {
        case V4L2_FIELD_TOP:
-- 
2.13.0

Reply via email to