From: Jiri Slaby Date: Sun, 21 Jun 2009 21:57:31 +0000 (+0200) Subject: Firmware: firmware_class, fix lock imbalance X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=308975fa7ab2a8e0b91186158128668c823790ce;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Firmware: firmware_class, fix lock imbalance Add omitted unlock in firmware_data_read. Signed-off-by: Jiri Slaby Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index fc466531260e..f285f441fab9 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -217,8 +217,10 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, ret_count = -ENODEV; goto out; } - if (offset > fw->size) - return 0; + if (offset > fw->size) { + ret_count = 0; + goto out; + } if (count > fw->size - offset) count = fw->size - offset;