From d6eb71a6d2eda21c8cd7a4dcd6207a0d94eb6ae7 Mon Sep 17 00:00:00 2001 From: Vaibhav Jain Date: Wed, 23 Sep 2015 08:37:59 +0530 Subject: cxl: Fix lockdep warning while creating afu_err_buff attribute Presently a lockdep warning is reported during creation of afu_err_buff bin_attribute for the afu. This is caused due to the variable attr.key not pointing to a static class key, hence the function lockdep_init_map reports this warning: BUG: key not in .data! The patch fixes this issue by calling sysfs_attr_init on the attr_eb.attr structure before populating it with the afu_err_buff file details. This will populate the attr.key variable with a static class key so that lockdep_init_map stops complaining about the lockdep key not being static. Reported-by: Daniel Axtens Signed-off-by: Vaibhav Jain Acked-by: Ian Munsie Reviewed-by: Daniel Axtens Signed-off-by: Michael Ellerman --- drivers/misc/cxl/sysfs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/misc') diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c index 25868c2ec03e..02006f7109a8 100644 --- a/drivers/misc/cxl/sysfs.c +++ b/drivers/misc/cxl/sysfs.c @@ -592,6 +592,8 @@ int cxl_sysfs_afu_add(struct cxl_afu *afu) /* conditionally create the add the binary file for error info buffer */ if (afu->eb_len) { + sysfs_attr_init(&afu->attr_eb.attr); + afu->attr_eb.attr.name = "afu_err_buff"; afu->attr_eb.attr.mode = S_IRUGO; afu->attr_eb.size = afu->eb_len; -- cgit v1.2.3