[PATCH] sd: make open_cnt unsigned

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You really cannot have a negative number of openers.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/scsi/sg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 118c7b4a8af2..d38fa3fe031b 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -169,7 +169,7 @@ typedef struct sg_device { /* holds the state of each scsi generic device */
 	rwlock_t sfd_lock;      /* protect access to sfd list */
 	atomic_t detaching;     /* 0->device usable, 1->device detaching */
 	bool exclude;		/* 1->open(O_EXCL) succeeded and is active */
-	int open_cnt;		/* count of opens (perhaps < num(sfds) ) */
+	unsigned int open_cnt;	/* count of opens (perhaps < num(sfds) ) */
 	char sgdebug;		/* 0->off, 1->sense, 9->dump dev, 10-> all devs */
 	char name[DISK_NAME_LEN];
 	struct cdev * cdev;	/* char_dev [sysfs: /sys/cdev/major/sg<n>] */
-- 
2.35.3




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux