powerpc/powernv : Drop reference added by kset_find_obj()
In a situation, where Linux kernel gets notified about duplicate error log from OPAL, it is been observed that kernel fails to remove sysfs entries (/sys/firmware/opal/elog/0xXXXXXXXX) of such error logs. This is because, we currently search the error log/dump kobject in the kset list via 'kset_find_obj()' routine. Which eventually increment the reference count by one, once it founds the kobject. So, unless we decrement the reference count by one after it found the kobject, we would not be able to release the kobject properly later. This patch adds the 'kobject_put()' which was missing earlier. Signed-off-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Cc: stable@vger.kernel.org Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
这个提交包含在:
@@ -247,6 +247,7 @@ static irqreturn_t elog_event(int irq, void *data)
|
||||
uint64_t elog_type;
|
||||
int rc;
|
||||
char name[2+16+1];
|
||||
struct kobject *kobj;
|
||||
|
||||
rc = opal_get_elog_size(&id, &size, &type);
|
||||
if (rc != OPAL_SUCCESS) {
|
||||
@@ -269,8 +270,12 @@ static irqreturn_t elog_event(int irq, void *data)
|
||||
* that gracefully and not create two conflicting
|
||||
* entries.
|
||||
*/
|
||||
if (kset_find_obj(elog_kset, name))
|
||||
kobj = kset_find_obj(elog_kset, name);
|
||||
if (kobj) {
|
||||
/* Drop reference added by kset_find_obj() */
|
||||
kobject_put(kobj);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
create_elog_obj(log_id, elog_size, elog_type);
|
||||
|
||||
|
在新工单中引用
屏蔽一个用户