X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fchar%2Fsynclink_gt.c;h=64e835f62438d3bb6b629224355403c14681927a;hb=4937ce87959629d31e9b09cf5bdf1e12a305c805;hp=bbb7f1292665267bf22f3a59afb455abfb5aaf00;hpb=c21723edd5f6c288ab613ed658b7140e07fc7209;p=linux-2.6 diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index bbb7f12926..64e835f624 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c @@ -206,10 +206,10 @@ static void flush_cond_wait(struct cond_wait **head); */ struct slgt_desc { - unsigned short count; - unsigned short status; - unsigned int pbuf; /* physical address of data buffer */ - unsigned int next; /* physical address of next descriptor */ + __le16 count; + __le16 status; + __le32 pbuf; /* physical address of data buffer */ + __le32 next; /* physical address of next descriptor */ /* driver book keeping */ char *buf; /* virtual address of data buffer */ @@ -1565,6 +1565,9 @@ static int hdlcdev_open(struct net_device *dev) int rc; unsigned long flags; + if (!try_module_get(THIS_MODULE)) + return -EBUSY; + DBGINFO(("%s hdlcdev_open\n", dev->name)); /* generic HDLC layer open processing */ @@ -1634,6 +1637,7 @@ static int hdlcdev_close(struct net_device *dev) info->netcount=0; spin_unlock_irqrestore(&info->netlock, flags); + module_put(THIS_MODULE); return 0; }