public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] tty: mxser: forever loops on error
@ 2013-04-09  5:18 Dan Carpenter
  2013-04-09  5:50 ` Alexey Khoroshilov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-04-09  5:18 UTC (permalink / raw)
  To: Jiri Slaby, Alexey Khoroshilov
  Cc: Greg Kroah-Hartman, linux-kernel, kernel-janitors

There were a couple signedness bugs decrementing "i" which would lead to
a forever loops.

I've made a couple other variables signed as well because they are all
related array offsets and it would be weird if they weren't the same
type.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index d996038..a095859 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -2556,9 +2556,9 @@ static int mxser_probe(struct pci_dev *pdev,
 {
 #ifdef CONFIG_PCI
 	struct mxser_board *brd;
-	unsigned int i, j;
 	unsigned long ioaddress;
 	struct device *tty_dev;
+	int i, j;
 	int retval = -EINVAL;
 
 	for (i = 0; i < MXSER_BOARDS; i++)
@@ -2700,7 +2700,7 @@ static int __init mxser_module_init(void)
 {
 	struct mxser_board *brd;
 	struct device *tty_dev;
-	unsigned int b, i, m;
+	int b, i, m;
 	int retval;
 
 	mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] tty: mxser: forever loops on error
  2013-04-09  5:18 [patch] tty: mxser: forever loops on error Dan Carpenter
@ 2013-04-09  5:50 ` Alexey Khoroshilov
  2013-04-09  6:22   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2013-04-09  5:50 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jiri Slaby, Greg Kroah-Hartman, linux-kernel, kernel-janitors

Hi Dan,

Thank you for the patch.

We are also trying to fix the issue:
https://lkml.org/lkml/2013/2/19/29
https://lkml.org/lkml/2013/4/8/55

and the fix is finally in Greg's tty git tree since yesterday:
    git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
(tty-linus branch).

Best regards,
Alexey


On 04/09/2013 09:18 AM, Dan Carpenter wrote:
> There were a couple signedness bugs decrementing "i" which would lead to
> a forever loops.
>
> I've made a couple other variables signed as well because they are all
> related array offsets and it would be weird if they weren't the same
> type.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
> index d996038..a095859 100644
> --- a/drivers/tty/mxser.c
> +++ b/drivers/tty/mxser.c
> @@ -2556,9 +2556,9 @@ static int mxser_probe(struct pci_dev *pdev,
>  {
>  #ifdef CONFIG_PCI
>  	struct mxser_board *brd;
> -	unsigned int i, j;
>  	unsigned long ioaddress;
>  	struct device *tty_dev;
> +	int i, j;
>  	int retval = -EINVAL;
>  
>  	for (i = 0; i < MXSER_BOARDS; i++)
> @@ -2700,7 +2700,7 @@ static int __init mxser_module_init(void)
>  {
>  	struct mxser_board *brd;
>  	struct device *tty_dev;
> -	unsigned int b, i, m;
> +	int b, i, m;
>  	int retval;
>  
>  	mxvar_sdriver = alloc_tty_driver(MXSER_PORTS + 1);
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] tty: mxser: forever loops on error
  2013-04-09  5:50 ` Alexey Khoroshilov
@ 2013-04-09  6:22   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2013-04-09  6:22 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Jiri Slaby, kbuild, Greg Kroah-Hartman, linux-kernel,
	kernel-janitors

On Tue, Apr 09, 2013 at 09:50:35AM +0400, Alexey Khoroshilov wrote:
> Hi Dan,
> 
> Thank you for the patch.
> 
> We are also trying to fix the issue:
> https://lkml.org/lkml/2013/2/19/29
> https://lkml.org/lkml/2013/4/8/55
> 
> and the fix is finally in Greg's tty git tree since yesterday:
>     git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
> (tty-linus branch).
> 

Good deal.

Btw, by the time that Fenguang's kbuild scripts emailed you, it was
already too late to send a v2 patch.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-04-09  6:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09  5:18 [patch] tty: mxser: forever loops on error Dan Carpenter
2013-04-09  5:50 ` Alexey Khoroshilov
2013-04-09  6:22   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox