Skip to content

Commit 5ddac92

Browse files
keeschleroy
authored andcommitted
soc: fsl: qbman: Remove const from portal->cgrs allocation type
In preparation for making the kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct qman_cgrs *", but the returned type, while technically matching, is const qualified. As there is no general way to remove const qualifiers, adjust the allocation type to match the assignment. Signed-off-by: Kees Cook <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christophe Leroy <[email protected]>
1 parent 152f33e commit 5ddac92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/soc/fsl/qbman/qman.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static int qman_create_portal(struct qman_portal *portal,
12701270
qm_dqrr_set_ithresh(p, QMAN_PIRQ_DQRR_ITHRESH);
12711271
qm_mr_set_ithresh(p, QMAN_PIRQ_MR_ITHRESH);
12721272
qm_out(p, QM_REG_ITPR, QMAN_PIRQ_IPERIOD);
1273-
portal->cgrs = kmalloc_array(2, sizeof(*cgrs), GFP_KERNEL);
1273+
portal->cgrs = kmalloc_array(2, sizeof(*portal->cgrs), GFP_KERNEL);
12741274
if (!portal->cgrs)
12751275
goto fail_cgrs;
12761276
/* initial snapshot is no-depletion */

0 commit comments

Comments
 (0)