Use int instead of u_int for the 'extra' argument to the

clone_create() KPI.
This fixes a signedness bug in unit number comparisons.

Submitted by:	imp, Landon Fuller
PR:		kern/105228
MFC after:	2 weeks
This commit is contained in:
Bruce M Simpson 2007-02-02 22:27:45 +00:00
parent 3250f640aa
commit 217f71d80c
3 changed files with 3 additions and 3 deletions

View File

@ -803,7 +803,7 @@ clone_setup(struct clonedevs **cdp)
}
int
clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, u_int extra)
clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, int extra)
{
struct clonedevs *cd;
struct cdev *dev, *ndev, *dl, *de;

View File

@ -255,7 +255,7 @@ tapmodevent(module_t mod, int type, void *data)
static void
tapclone(void *arg, struct ucred *cred, char *name, int namelen, struct cdev **dev)
{
u_int extra;
int extra;
int i, unit;
char *device_name = name;

View File

@ -240,7 +240,7 @@ void clone_setup(struct clonedevs **cdp);
void clone_cleanup(struct clonedevs **);
#define CLONE_UNITMASK 0xfffff
#define CLONE_FLAG0 (CLONE_UNITMASK + 1)
int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, u_int extra);
int clone_create(struct clonedevs **, struct cdevsw *, int *unit, struct cdev **dev, int extra);
int count_dev(struct cdev *_dev);
void destroy_dev(struct cdev *_dev);