From: Tobin C. Harding Date: Mon, 10 Apr 2017 03:15:40 +0000 (+1000) Subject: staging: ks7010: change length type to unsigned X-Git-Tag: Ubuntu-4.12.0-11.12~1180^2~188 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=881f76b976e8e1ce8bb0498d0a85f3a43a6397dd;hp=5141e9c6346892d9705558ccf27489806c2bdddf;p=mirror_ubuntu-artful-kernel.git staging: ks7010: change length type to unsigned Length undergoes type conversion when passed (indirectly) as an argument for parameter of type 'unsigned int'. If length is negative this is a bug (the value after conversion is large). Declare 'length' to be an unsigned type instead of a signed type. Reported-by: Dan Carpenter Signed-off-by: Tobin C. Harding Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 3403eddaa8e8..b93c9a478709 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -712,7 +712,7 @@ static int ks7010_upload_firmware(struct ks_sdio_card *card) unsigned char *rom_buf; unsigned char rw_data = 0; int ret; - int length; + unsigned int length; const struct firmware *fw_entry = NULL; /* buffer allocate */