speedtch usbatm.c,1.30,1.31
Duncan Sands
duncan at infradead.org
Tue May 3 09:53:15 EDT 2005
Update of /home/cvs/speedtch
In directory phoenix.infradead.org:/tmp/cvs-serv937
Modified Files:
usbatm.c
Log Message:
White space changes. Using skb_pull rather than __skb_pull is pointless here.
Reorder variable declarations to get better stack alignment on platforms where
a pointer > int. Tweak the error handling in usbatm_atm_open.
Index: usbatm.c
===================================================================
RCS file: /home/cvs/speedtch/usbatm.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- usbatm.c 3 May 2005 10:10:33 -0000 1.30
+++ usbatm.c 3 May 2005 13:53:12 -0000 1.31
@@ -439,7 +439,7 @@
memcpy(ptr, skb->data, data_len);
ptr += data_len;
- skb_pull(skb, data_len);
+ __skb_pull(skb, data_len);
if(!left)
continue;
@@ -496,8 +496,7 @@
}
else
if (!urb->status)
- usbatm_extract_cells(instance, urb->transfer_buffer,
- urb->actual_length);
+ usbatm_extract_cells(instance, urb->transfer_buffer, urb->actual_length);
if (usbatm_submit_transceiver(rx))
return;
@@ -514,9 +513,9 @@
struct usbatm_data *instance = (struct usbatm_data *)data;
struct sk_buff *skb = instance->current_skb;
struct usbatm_transceiver *tx = NULL;
- unsigned int num_written = 0;
- const unsigned int buf_size = instance->tx_channel.buf_size;
u8 *buffer = NULL;
+ const unsigned int buf_size = instance->tx_channel.buf_size;
+ unsigned int num_written = 0;
if (!skb)
skb = skb_dequeue(&instance->sndqueue);
@@ -723,7 +722,8 @@
static int usbatm_atm_open(struct atm_vcc *vcc)
{
struct usbatm_data *instance = vcc->dev->dev_data;
- struct usbatm_vcc_data *new;
+ struct usbatm_vcc_data *new = NULL;
+ int ret;
int vci = vcc->vci;
short vpi = vcc->vpi;
@@ -745,14 +745,14 @@
if (usbatm_find_vcc(instance, vpi, vci)) {
atm_dbg(instance, "%s: %hd/%d already in use!\n", __func__, vpi, vci);
- up(&instance->serialize);
- return -EADDRINUSE;
+ ret = -EADDRINUSE;
+ goto fail;
}
if (!(new = kmalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) {
atm_dbg(instance, "%s: no memory for vcc_data!\n", __func__);
- up(&instance->serialize);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto fail;
}
memset(new, 0, sizeof(struct usbatm_vcc_data));
@@ -763,9 +763,8 @@
new->sarb = alloc_skb(usbatm_pdu_length(vcc->qos.rxtp.max_sdu), GFP_KERNEL);
if (!new->sarb) {
atm_dbg(instance, "%s: no memory for SAR buffer!\n", __func__);
- kfree(new);
- up(&instance->serialize);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto fail;
}
vcc->dev_data = new;
@@ -783,6 +782,11 @@
atm_dbg(instance, "%s: allocated vcc data 0x%p\n", __func__, new);
return 0;
+
+fail:
+ kfree(new);
+ up(&instance->serialize);
+ return ret;
}
static void usbatm_atm_close(struct atm_vcc *vcc)
More information about the Usbatm-commits
mailing list