staging: ccree: alloc by instance not type
authorGilad Ben-Yossef <gilad@benyossef.com>
Mon, 13 Nov 2017 14:45:30 +0000 (14:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Nov 2017 08:20:38 +0000 (09:20 +0100)
Allocation by instance is preferred to allocation by type.

Signed-off-by: Gilad Ben-Yossef <gilad@benyossef.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ccree/ssi_sram_mgr.c

index 2263433e0f2bf8ac96f17b907f15dd6fbfc0d129..b71460c2200b6910e1d359e526015639e09353dc 100644 (file)
@@ -51,7 +51,7 @@ void ssi_sram_mgr_fini(struct ssi_drvdata *drvdata)
 int ssi_sram_mgr_init(struct ssi_drvdata *drvdata)
 {
        /* Allocate "this" context */
-       drvdata->sram_mgr_handle = kzalloc(sizeof(struct ssi_sram_mgr_ctx),
+       drvdata->sram_mgr_handle = kzalloc(sizeof(*drvdata->sram_mgr_handle),
                                           GFP_KERNEL);
 
        if (!drvdata->sram_mgr_handle)