From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bxn46.internetdsl.tpnet.pl (HELO lapsg1.open-e.pl) (stf_xl@wp.pl@[83.18.247.46]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 5 Nov 2007 13:02:46 +0100 From: Stanislaw Gruszka To: drbd-dev@lists.linbit.com Date: Mon, 5 Nov 2007 13:04:49 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711051304.49960.stf_xl@wp.pl> Subject: [Drbd-dev] don't memset null pointer List-Id: Coordination of development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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);