staging: drm/imx: ipu-dc: signedness bug in ipu_dc_init_sync()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Aug 2013 08:30:08 +0000 (11:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Aug 2013 17:07:18 +0000 (10:07 -0700)
"map" needs to be signed for the error handling to work.  In the success
case then it holds a small non-negative value.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/ipu-v3/ipu-dc.c

index 59f03f9aefc3d63f122c92e6447e9edc3de001fb..21bf1c8065288edb83c34108f65885f264185434 100644 (file)
@@ -161,14 +161,15 @@ int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
                u32 pixel_fmt, u32 width)
 {
        struct ipu_dc_priv *priv = dc->priv;
-       u32 reg = 0, map;
+       u32 reg = 0;
+       int map;
 
        dc->di = ipu_di_get_num(di);
 
        map = ipu_pixfmt_to_map(pixel_fmt);
        if (map < 0) {
                dev_dbg(priv->dev, "IPU_DISP: No MAP\n");
-               return -EINVAL;
+               return map;
        }
 
        if (interlaced) {