[PATCH net] mcs7780: Silence uninitialized variable warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My static checker complains that, if the allocation in mcs_get_reg()
fails, it means we use "rval" without initializing it.  Small
allocations never fail in current kernels so it's not a major concern
but it's simple enough to silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index 765de3bedb88..64b29880e534 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -585,7 +585,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
 	int rst = 0;
 	int cnt = 0;
 	__u16 nspeed;
-	__u16 rval;
+	__u16 rval = -1;
 
 	nspeed = mcs_speed_set[(mcs->new_speed >> 8) & 0x0f];
 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux