patch "staging: kpc2000: prevent underflow in cpld_reconfigure()" added to staging-next
Subsystems (2)
This is a note to let you know that I've just added the patch titled
staging: kpc2000: prevent underflow in cpld_reconfigure()
to my staging git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
in the staging-next branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will also be merged in the next major kernel release during the merge window.
If you have any questions about this process, please let me know.
From 72db61d7d17a475d3cc9de1a7c871d518fcd82f0 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <[email protected]>
Date: Mon, 24 Feb 2020 13:33:25 +0300
Subject: staging: kpc2000: prevent underflow in cpld_reconfigure()
This function should not allow negative values of "wr_val". If negatives are allowed then capping the upper bound at 7 is meaningless. Let's make it unsigned.
--- drivers/staging/kpc2000/kpc2000/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/kpc2000/kpc2000/core.c +2 -2
@@ -110,10 +110,10 @@ static ssize_t cpld_reconfigure(struct device *dev, const char *buf, size_t count) {struct kp2000_device *pcard =dev_get_drvdata (dev); -long wr_val; +unsigned long wr_val;int rv; - rv =kstrtol (buf,0 , &wr_val); + rv =kstrtoul (buf,0 , &wr_val);if (rv <0 )return rv;if (wr_val >7 )
Signature · 1 line
2.25.1