Commit 3c359f06 authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman

Staging: gdm72xx: make "len" unsigned

We had an underflow bug here and I think I fixed it but we may as
well be proactive and make "len" unsigned to be double sure.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 724dfc25
......@@ -284,7 +284,7 @@ static void gdm_usb_send_complete(struct urb *urb)
spin_unlock_irqrestore(&tx->lock, flags);
}
static int gdm_usb_send(void *priv_dev, void *data, int len,
static int gdm_usb_send(void *priv_dev, void *data, size_t len,
void (*cb)(void *data), void *cb_data)
{
struct usbwm_dev *udev = priv_dev;
......@@ -341,7 +341,7 @@ static int gdm_usb_send(void *priv_dev, void *data, int len,
usb_fill_bulk_urb(t->urb, usbdev, usb_sndbulkpipe(usbdev, 1), t->buf,
len + padding, gdm_usb_send_complete, t);
dev_dbg(&usbdev->dev, "usb_send: %*ph\n", len + padding, t->buf);
dev_dbg(&usbdev->dev, "usb_send: %*ph\n", (int)len + padding, t->buf);
#ifdef CONFIG_WIMAX_GDM72XX_USB_PM
if (usbdev->state & USB_STATE_SUSPENDED) {
......@@ -460,7 +460,7 @@ static void gdm_usb_rcv_complete(struct urb *urb)
}
static int gdm_usb_receive(void *priv_dev,
void (*cb)(void *cb_data, void *data, int len),
void (*cb)(void *cb_data, void *data, size_t len),
void *cb_data)
{
struct usbwm_dev *udev = priv_dev;
......
......@@ -49,7 +49,7 @@ struct usb_rx {
struct rx_cxt *rx_cxt;
struct urb *urb;
u8 *buf;
void (*callback)(void *cb_data, void *data, int len);
void (*callback)(void *cb_data, void *data, size_t len);
void *cb_data;
};
......
......@@ -695,7 +695,7 @@ static void gdm_wimax_transmit_pkt(struct net_device *dev, char *buf, int len)
}
}
static void rx_complete(void *arg, void *data, int len)
static void rx_complete(void *arg, void *data, size_t len)
{
struct nic *nic = arg;
......@@ -703,7 +703,7 @@ static void rx_complete(void *arg, void *data, int len)
gdm_wimax_rcv_with_cb(nic, rx_complete, nic);
}
static void prepare_rx_complete(void *arg, void *data, int len)
static void prepare_rx_complete(void *arg, void *data, size_t len)
{
struct nic *nic = arg;
int ret;
......
......@@ -26,10 +26,10 @@
struct phy_dev {
void *priv_dev;
struct net_device *netdev;
int (*send_func)(void *priv_dev, void *data, int len,
int (*send_func)(void *priv_dev, void *data, size_t len,
void (*cb)(void *cb_data), void *cb_data);
int (*rcv_func)(void *priv_dev,
void (*cb)(void *cb_data, void *data, int len),
void (*cb)(void *cb_data, void *data, size_t len),
void *cb_data);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment