This patch prevents a potential integer overlow.

Reported-by: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Christian Gromm <christian.gr...@microchip.com>
---
 drivers/staging/most/mostcore/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/mostcore/core.c 
b/drivers/staging/most/mostcore/core.c
index f872dc0..f4fea8c 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -1260,7 +1260,7 @@ int arm_mbo_chain(struct most_c_obj *c, int dir, void 
(*compl)(struct mbo *))
        unsigned int i;
        int retval;
        struct mbo *mbo;
-       u16 coherent_buf_size = c->cfg.buffer_size + c->cfg.extra_len;
+       u32 coherent_buf_size = c->cfg.buffer_size + c->cfg.extra_len;
 
        atomic_set(&c->mbo_nq_level, 0);
 
-- 
1.7.9.5

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to