From: Dan Magenheimer <dan.magenheimer@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: RE: [patch] Staging: zcache: signedness bug in tmem_get()
Date: Tue, 09 Aug 2011 21:23:33 +0000 [thread overview]
Message-ID: <c20f30dd-eef1-46d5-89df-bc5af40fd865@default> (raw)
In-Reply-To: <20110809180133.GB3830@shale.localdomain>
> From: Dan Carpenter [mailto:error27@gmail.com]
> Sent: Tuesday, August 09, 2011 12:02 PM
> To: Greg Kroah-Hartman
> Cc: Dan Magenheimer; open list:STAGING SUBSYSTEM; kernel-janitors@vger.kernel.org
> 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@gmail.com>
>
> 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@oracle.com>
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.
prev parent reply other threads:[~2011-08-09 21:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-09 18:01 [patch] Staging: zcache: signedness bug in tmem_get() Dan Carpenter
2011-08-09 21:23 ` Dan Magenheimer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c20f30dd-eef1-46d5-89df-bc5af40fd865@default \
--to=dan.magenheimer@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox