Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965882AbcJFJXH (ORCPT ); Thu, 6 Oct 2016 05:23:07 -0400 Received: from mout.web.de ([212.227.15.4]:59795 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965868AbcJFJXD (ORCPT ); Thu, 6 Oct 2016 05:23:03 -0400 Subject: [PATCH 24/54] md/raid1: Improve another size determination in setup_conf() To: linux-raid@vger.kernel.org, Christoph Hellwig , Guoqing Jiang , Jens Axboe , Mike Christie , Neil Brown , Shaohua Li , Tomasz Majchrzak References: <566ABCD9.1060404@users.sourceforge.net> <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <9831fce9-d689-89e4-dec8-50cadcd13fdd@users.sourceforge.net> Date: Thu, 6 Oct 2016 11:22:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <786843ef-4b6f-eb04-7326-2f6f5b408826@users.sourceforge.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ps/TDaeBs8B63pmYjqCsMWw+iiMlmKO3mBZNHuT7TdhDAJWfsfk sAKVrZt96LNuGrywOY3CS63R/dP8mpdSIqZru/tRJTkEOlNxKhw4zZ1natfFa6qcEzo89Dr Vx+737EmPQGhhmukJdFTIV5dY2pjDRxIuWdHj6Uxg7OlGCH/3Gx6Yp2cauzSHC1ohYtwkEr GBGE2q4N4qB7+ZsJB6jwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:GpARg2BEeLA=:avrGqUF70C7749+3S/mkxJ CatWBbOUG8LrJuEAZOYbHw9/XlSE2VO8nr8j+fE0wvwlTQdeuioVOJm07pIVB7DUV5cu5IW+p Iu6uPipH5E0lRXaRV9bCC0taJHuAwYSd/3Zw9H1nGAvaXKM8Zm4EYCK/mbotsndslSIMrKQkx 6qfwTUgN4saKlL0s+4It//tjF6plMluQeTp+5IffcwdNoKJBLf8hdipBGLn978rxWMPedjCli wJJVMIG2tAQVzrIkPJWrLivqFMSju0HfznMAcW3BTmoTtIzNG4k/xZlljOH8kgWbILkwFKbKT o2Rkdns1KhKVEiQ3Y8mKH+vu5vA4tDllgoxzXabBmVrhjv/RctUK0cO7SUvwXQ62VxVaxw54w 1inak9uk0YdGRWOzjBtu7zrPerzdGySQbvrKcXAJEFcY4aToMNRLfa0e+gTCZ/KvNmXLcFK3f vty24Y8ITLvfZC1BgnzxReE+CKhDqD3+bz0Pg48vCM3eQZN9G3iwNUIoDgPv59+r0YZYl+qdb rcX/MBgaLQrDx0gy0fC+9m7TX3zIfGB1LBIEFBy3qdSeZxZKDzCtC9WePrpw+d6sz1osA1+vY Yja1uAW4tluqvP210xdj1pzRdeNinB1wxfAKFIYIrQwGhH3S+pmENLppg1NzM4y1Nw2G2prZT /8gXN42wX54Qjv+G4LERDuzCpeGk66RT4OxayZxmD54w/znm3ON/pBeMF9RcG9F5jZ4IO9RXR 68mtVUwHhI3+A6QAr13/XEtxTES1QsRwz3teuZ1E4++zs0e6lDiBY9z5aXUaE60BMVgAzP/Bd Z3O5BsT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 803 Lines: 27 From: Markus Elfring Date: Tue, 4 Oct 2016 21:46:18 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer. Signed-off-by: Markus Elfring --- drivers/md/raid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ec6aafb..5e1a427 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -2776,7 +2776,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) struct md_rdev *rdev; int err; - conf = kzalloc(sizeof(struct r1conf), GFP_KERNEL); + conf = kzalloc(sizeof(*conf), GFP_KERNEL); if (!conf) return ERR_PTR(-ENOMEM); -- 2.10.1