dlm: Improve a size determination in dlm_recover_waiters_pre()
authorMarkus Elfring <elfring@users.sourceforge.net>
Sat, 6 May 2017 06:48:29 +0000 (08:48 +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/lock.c

index fd6fe55..ffadb81 100644 (file)
@@ -5119,7 +5119,7 @@ void dlm_recover_waiters_pre(struct dlm_ls *ls)
        int wait_type, stub_unlock_result, stub_cancel_result;
        int dir_nodeid;
 
-       ms_stub = kmalloc(sizeof(struct dlm_message), GFP_KERNEL);
+       ms_stub = kmalloc(sizeof(*ms_stub), GFP_KERNEL);
        if (!ms_stub) {
                log_error(ls, "dlm_recover_waiters_pre no mem");
                return;