From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() Date: Wed, 12 Oct 2016 11:28:39 +0300 Message-ID: <20161012074307.GB5687@mwanda> References: <566ABCD9.1060404@users.sourceforge.net> <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> <9831fce9-d689-89e4-dec8-50cadcd13fdd@users.sourceforge.net> <20161007075345.GB6039@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Jes Sorensen Cc: Richard Weinberger , SF Markus Elfring , "linux-raid@vger.kernel.org" , Christoph Hellwig , Guoqing Jiang , Jens Axboe , Mike Christie , Neil Brown , Shaohua Li , Tomasz Majchrzak , LKML , "kernel-janitors@vger.kernel.org" , Julia Lawall List-Id: linux-raid.ids Compare: foo = kmalloc(sizeof(*foo), GFP_KERNEL); This says you are allocating enough space for foo. It can be reviewed by looking at one line. If you change the type of foo it will still work. foo = kmalloc(sizeof(struct whatever), GFP_KERNEL); There isn't enough information to say if this is correct. If you change the type of foo then you have to update the allocation as well. It's not a super common type of bug, but I see it occasionally. regards, dan carpenter