kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: crystalhd: fix signed bug
@ 2010-09-12 18:56 Vasiliy Kulikov
  2010-09-28 19:01 ` Jarod Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Vasiliy Kulikov @ 2010-09-12 18:56 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Greg Kroah-Hartman, Jarod Wilson, Manu Abraham, Scott Davilla,
	Lars Lindley, devel, linux-kernel

chd_dec_major is unsigned, so check chd_dec_major < 0 doesn't make sense.
Since it is used as signed, declare it as int.

Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
---
 Compile tested.

 drivers/staging/crystalhd/crystalhd_lnx.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.h b/drivers/staging/crystalhd/crystalhd_lnx.h
index c951e43..a2b5a56 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.h
+++ b/drivers/staging/crystalhd/crystalhd_lnx.h
@@ -76,7 +76,7 @@ struct crystalhd_adp {
 	spinlock_t		lock;
 
 	/* API Related */
-	unsigned int		chd_dec_major;
+	int		chd_dec_major;
 	unsigned int		cfg_users;
 
 	struct crystalhd_ioctl_data	*idata_free_head;	/* ioctl data pool */
-- 
1.7.0.4


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

* Re: [PATCH] staging: crystalhd: fix signed bug
  2010-09-12 18:56 [PATCH] staging: crystalhd: fix signed bug Vasiliy Kulikov
@ 2010-09-28 19:01 ` Jarod Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Jarod Wilson @ 2010-09-28 19:01 UTC (permalink / raw)
  To: Vasiliy Kulikov
  Cc: kernel-janitors, Greg Kroah-Hartman, Manu Abraham, Scott Davilla,
	Lars Lindley, devel, linux-kernel

On Sun, Sep 12, 2010 at 10:56:51PM +0400, Vasiliy Kulikov wrote:
> chd_dec_major is unsigned, so check chd_dec_major < 0 doesn't make sense.
> Since it is used as signed, declare it as int.
> 
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>

Indeed, Bad Things here when we try to store the ret from register_chrdev
in an unsigned int and test it for < 0...

Acked-by: Jarod Wilson <jarod@redhat.com>

-- 
Jarod Wilson
jarod@redhat.com


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

end of thread, other threads:[~2010-09-28 19:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-12 18:56 [PATCH] staging: crystalhd: fix signed bug Vasiliy Kulikov
2010-09-28 19:01 ` Jarod Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).