Commit 3c25ce69 authored by Olof Johansson's avatar Olof Johansson

Merge tag 'scmi-fix-5.5-2' of...

Merge tag 'scmi-fix-5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes

ARM SCMI fix for v5.5

Yet another single fix to avoid double freeing in scmi_device_create
error path

* tag 'scmi-fix-5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux:
  firmware: arm_scmi: Avoid double free in error flow
  firmware: arm_scmi: Fix doorbell ring logic for !CONFIG_64BIT

Link: https://lore.kernel.org/r/20191202114559.GB20965@bogusSigned-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 563b75d7 8305e90a
...@@ -135,8 +135,10 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol) ...@@ -135,8 +135,10 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
return NULL; return NULL;
id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL); id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
if (id < 0) if (id < 0) {
goto free_mem; kfree(scmi_dev);
return NULL;
}
scmi_dev->id = id; scmi_dev->id = id;
scmi_dev->protocol_id = protocol; scmi_dev->protocol_id = protocol;
...@@ -154,8 +156,6 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol) ...@@ -154,8 +156,6 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
put_dev: put_dev:
put_device(&scmi_dev->dev); put_device(&scmi_dev->dev);
ida_simple_remove(&scmi_bus_id, id); ida_simple_remove(&scmi_bus_id, id);
free_mem:
kfree(scmi_dev);
return NULL; return NULL;
} }
......
...@@ -323,7 +323,7 @@ static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db) ...@@ -323,7 +323,7 @@ static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db)
if (db->mask) if (db->mask)
val = ioread64_hi_lo(db->addr) & db->mask; val = ioread64_hi_lo(db->addr) & db->mask;
iowrite64_hi_lo(db->set, db->addr); iowrite64_hi_lo(db->set | val, db->addr);
} }
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment