RE: [patch] Staging: zcache: signedness bug in tmem_get()

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

 



> From: Dan Carpenter [mailto:error27@xxxxxxxxx]
> Sent: Tuesday, August 09, 2011 12:02 PM
> To: Greg Kroah-Hartman
> Cc: Dan Magenheimer; open list:STAGING SUBSYSTEM; kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [patch] Staging: zcache: signedness bug in tmem_get()
> 
> "ret" needs to be signed for the error handling to work properly.
> 
> Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
> 
> diff --git a/drivers/staging/zcache/tmem.c b/drivers/staging/zcache/tmem.c
> index 975e34b..1ca66ea 100644
> --- a/drivers/staging/zcache/tmem.c
> +++ b/drivers/staging/zcache/tmem.c
> @@ -604,7 +604,7 @@ int tmem_get(struct tmem_pool *pool, struct tmem_oid *oidp, uint32_t index,
>  	struct tmem_obj *obj;
>  	void *pampd;
>  	bool ephemeral = is_ephemeral(pool);
> -	uint32_t ret = -1;
> +	int ret = -1;
>  	struct tmem_hashbucket *hb;
>  	bool free = (get_and_free == 1) || ((get_and_free == 0) && ephemeral);
>  	bool lock_held = false;

Acked-by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>

I discovered this bug also a couple of weeks ago debugging RAMster but
have convinced myself that, in zcache, the problem would never manifest
so didn't post the fix.  Still best to have it fixed though as it was a
huge pain to track down in RAMster... thanks for posting the fix Dan.
--
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