mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
target: Fix sizeof in kmalloc for some default_groups arrays
Allocating an array of pointers, not the objects themselves. These two sites now match all the other sites. Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
This commit is contained in:
parent
3f0ed57b26
commit
ab6dae8236
@ -2937,7 +2937,7 @@ static int __init target_core_init_configfs(void)
|
|||||||
* and ALUA Logical Unit Group and Target Port Group infrastructure.
|
* and ALUA Logical Unit Group and Target Port Group infrastructure.
|
||||||
*/
|
*/
|
||||||
target_cg = &subsys->su_group;
|
target_cg = &subsys->su_group;
|
||||||
target_cg->default_groups = kmalloc(sizeof(struct config_group) * 2,
|
target_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!target_cg->default_groups) {
|
if (!target_cg->default_groups) {
|
||||||
pr_err("Unable to allocate target_cg->default_groups\n");
|
pr_err("Unable to allocate target_cg->default_groups\n");
|
||||||
|
@ -906,7 +906,7 @@ static struct config_group *target_fabric_make_lun(
|
|||||||
lun_cg->default_groups[1] = NULL;
|
lun_cg->default_groups[1] = NULL;
|
||||||
|
|
||||||
port_stat_grp = &lun->port_stat_grps.stat_group;
|
port_stat_grp = &lun->port_stat_grps.stat_group;
|
||||||
port_stat_grp->default_groups = kzalloc(sizeof(struct config_group) * 4,
|
port_stat_grp->default_groups = kzalloc(sizeof(struct config_group *) * 4,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!port_stat_grp->default_groups) {
|
if (!port_stat_grp->default_groups) {
|
||||||
pr_err("Unable to allocate port_stat_grp->default_groups\n");
|
pr_err("Unable to allocate port_stat_grp->default_groups\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user