Skip to content

Commit cfc1d68

Browse files
sjp38dbaluta
authored andcommitted
templates/device_model/bex_misc: Fix wrong 'bmd' alloc
'bmd' is 'struct bex_misc_device' object, but size of 'struct miscdevice' is allocated for that. This commit fixes the wrong allocation size. Signed-off-by: SeongJae Park <sj38.park@gmail.com>
1 parent b7f1bfb commit cfc1d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/labs/templates/device_model/bex_misc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int bex_misc_probe(struct bex_device *dev)
8888
return -ENODEV;
8989
}
9090

91-
bmd = kzalloc(sizeof(struct miscdevice), GFP_KERNEL);
91+
bmd = kzalloc(sizeof(*bmd), GFP_KERNEL);
9292
if (!bmd)
9393
return -ENOMEM;
9494

0 commit comments

Comments
 (0)