ARM SCMI fix for v5.5

Yet another single fix to avoid double freeing in scmi_device_create
 error path
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEunHlEgbzHrJD3ZPhAEG6vDF+4pgFAl3k9oYACgkQAEG6vDF+
 4phQLRAAm8igCvWC3nk8NvdaM7gsB3PXhVwjCfrmXh/yd3o0yl5gqGpPrpgYi7Hu
 HJG0HvnzzQO1NQfshx8woxHiiYwEKAnAmyxQeeI9co5UF/FHJN95PfEKbcdiULvL
 Tr9XyCYA6ACfxkGq8fPlUiaftNOImOySXLSK1x4Hp/P+EZFkGvBzwEpXXouTt1FX
 S/rINY9d7lJxzJGgLh/Zl1mM1Y8kCSEEW9WGgyJRssIKDZaznDrkOHVjpzKgXss3
 ipgmOA+I+sKpp9bAFzBOwfMfAfhAgNXkrfsntbi55rxqBD4OfPEuHfDZYdAYOZsT
 p2s7hYdufb6O0F3S2Wml4btW/F8XDVRUVypeUx5mSW9x13g4vQTnqQSYlqq3ABPe
 w5Mffye/WNaWT35cYm13QIsQ2aK341txTXGs66414gajbe6x6lqkZ3BiZAKgXTre
 eqQdhw9TfL6eQld06Hghvo/nkDoHN3mTaZ2SVz53Coxvy83H/XP00tXV2P4SEMnM
 +j9JyhdM3UoJAOXO7Mb0vVH6AuxJk3f57EBqQJZLSJuph/4rCf6YM95yPXFAwLxt
 1OOeuLauZ2x11bQM2hOxdIoIYntRnJVu0AS9HAcGfZ9CYqF8rzgZZXfRsa/9CRMM
 kSB7MWTCHeXhM75gRX7lKWVAkCGZkbeRb0lOS/ocSyb0dQ+5aYU=
 =kDMl
 -----END PGP SIGNATURE-----

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@bogus
Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
Olof Johansson 2019-12-05 10:11:49 -08:00
commit 3c25ce694a
2 changed files with 5 additions and 5 deletions

View File

@ -135,8 +135,10 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
return NULL;
id = ida_simple_get(&scmi_bus_id, 1, 0, GFP_KERNEL);
if (id < 0)
goto free_mem;
if (id < 0) {
kfree(scmi_dev);
return NULL;
}
scmi_dev->id = id;
scmi_dev->protocol_id = protocol;
@ -154,8 +156,6 @@ scmi_device_create(struct device_node *np, struct device *parent, int protocol)
put_dev:
put_device(&scmi_dev->dev);
ida_simple_remove(&scmi_bus_id, id);
free_mem:
kfree(scmi_dev);
return NULL;
}

View File

@ -323,7 +323,7 @@ static void scmi_perf_fc_ring_db(struct scmi_fc_db_info *db)
if (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
}