dlm: Improve a size determination in table_seq_start()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 6 May 2017 06:34:27 +0000 (08:34 +0200)
committerDavid Teigland <teigland@redhat.com>
Mon, 7 Aug 2017 16:23:09 +0000 (11:23 -0500)
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 according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/debug_fs.c

index 551e0f8dbe0db8ecf85c84cc0ae1ab7881ab0591..fa08448e35dd7dd50fedaae4b95e48e974d343c4 100644 (file)
@@ -435,7 +435,7 @@ static void *table_seq_start(struct seq_file *seq, loff_t *pos)
        if (bucket >= ls->ls_rsbtbl_size)
                return NULL;
 
-       ri = kzalloc(sizeof(struct rsbtbl_iter), GFP_NOFS);
+       ri = kzalloc(sizeof(*ri), GFP_NOFS);
        if (!ri)
                return NULL;
        if (n == 0)