From: Philipp Reisner <philipp.reisner@linbit.com>
To: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] don't memset null pointer
Date: Mon, 5 Nov 2007 14:07:48 +0100 [thread overview]
Message-ID: <200711051407.49111.philipp.reisner@linbit.com> (raw)
In-Reply-To: <200711051304.49960.stf_xl@wp.pl>
On Monday 05 November 2007 13:04:49 Stanislaw Gruszka wrote:
> Hi, this is trivial fix for memset null pointer:
>
> diff --git a/drbd/lru_cache.c b/drbd/lru_cache.c
> index a3171b6..37ab276 100644
> --- a/drbd/lru_cache.c
> +++ b/drbd/lru_cache.c
> @@ -57,8 +57,8 @@ struct lru_cache *lc_alloc(const char *name, unsigned int
> e_count, bytes *= e_count;
> bytes += sizeof(struct lru_cache);
> lc = vmalloc(bytes);
> - memset(lc, 0, bytes);
> if (lc) {
> + memset(lc, 0, bytes);
> INIT_LIST_HEAD(&lc->in_use);
> INIT_LIST_HEAD(&lc->lru);
> INIT_LIST_HEAD(&lc->free);
Thanks!
-Phil
--
: Dipl-Ing Philipp Reisner Tel +43-1-8178292-50 :
: LINBIT Information Technologies GmbH Fax +43-1-8178292-82 :
: Vivenotgasse 48, 1120 Vienna, Austria http://www.linbit.com :
prev parent reply other threads:[~2007-11-05 13:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-05 12:04 [Drbd-dev] don't memset null pointer Stanislaw Gruszka
2007-11-05 13:07 ` Philipp Reisner [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=200711051407.49111.philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=drbd-dev@lists.linbit.com \
/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