Small fixes for "platform/surface: aggregator: Extend user-space
interface for events".
Specifically, prevent use of an uniniitalized variable and drop an
unnecessary initialization.
Maximilian Luz (2):
platform/surface: aggregator: Do not return uninitialized value
platform/surface: aggregator: Drop unnecessary variable initialization
drivers/platform/surface/aggregator/controller.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
2.31.1
The status variable in ssam_controller_event_disable() is always set, no
need to initialize it.
Signed-off-by: Maximilian Luz <[email protected]>
---
drivers/platform/surface/aggregator/controller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c
index 634399387d76..b8c377b3f932 100644
--- a/drivers/platform/surface/aggregator/controller.c
+++ b/drivers/platform/surface/aggregator/controller.c
@@ -2464,7 +2464,7 @@ int ssam_controller_event_disable(struct ssam_controller *ctrl,
u16 rqid = ssh_tc_to_rqid(id.target_category);
struct ssam_nf *nf = &ctrl->cplt.event.notif;
struct ssam_nf_refcount_entry *entry;
- int status = 0;
+ int status;
if (!ssh_rqid_is_event(rqid))
return -EINVAL;
--
2.31.1
The status variable in ssam_nf_refcount_disable_free() is only set when
the reference count equals zero. Otherwise, it is returned
uninitialized. Fix this by always initializing status to zero.
Reported-by: kernel test robot <[email protected]>
Fixes: 640ee17199e4 ("platform/surface: aggregator: Allow enabling of events without notifiers")
Signed-off-by: Maximilian Luz <[email protected]>
---
drivers/platform/surface/aggregator/controller.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c
index 6646f4d6e10d..634399387d76 100644
--- a/drivers/platform/surface/aggregator/controller.c
+++ b/drivers/platform/surface/aggregator/controller.c
@@ -2228,7 +2228,7 @@ static int ssam_nf_refcount_disable_free(struct ssam_controller *ctrl,
const struct ssam_event_registry reg = entry->key.reg;
const struct ssam_event_id id = entry->key.id;
struct ssam_nf *nf = &ctrl->cplt.event.notif;
- int status;
+ int status = 0;
lockdep_assert_held(&nf->lock);
--
2.31.1
Hi,
On 6/4/21 11:09 PM, Maximilian Luz wrote:
> Small fixes for "platform/surface: aggregator: Extend user-space
> interface for events".
>
> Specifically, prevent use of an uniniitalized variable and drop an
> unnecessary initialization.
>
> Maximilian Luz (2):
> platform/surface: aggregator: Do not return uninitialized value
> platform/surface: aggregator: Drop unnecessary variable initialization
Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans