Skip to content

Commit 0e90ed0

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (24 commits) usbnet: Remove over-broad module alias from zaurus. MAINTAINERS: drop Michael from bfin_mac driver net/can: activate bit-timing calculation and netlink based drivers by default rionet: fix NULL pointer dereference in rionet_remove net+crypto: Use vmalloc for zlib inflate buffers. netfilter: Fix ip_route_me_harder triggering ip_rt_bug ipv4: Fix IPsec slowpath fragmentation problem ipv4: Fix packet size calculation in __ip_append_data cxgb3: skb_record_rx_queue now records the queue index relative to the net_device. bridge: Only flood unregistered groups to routers qlge: Add maintainer. MAINTAINERS: mark socketcan-core lists as subscribers-only MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED r8169: fix wrong register use. net/usb/kalmia: signedness bug in kalmia_bind() net/usb: kalmia: Various fixes for better support of non-x86 architectures. rtl8192cu: Fix missing firmware load udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet ipv6/udp: Use the correct variable to determine non-blocking condition netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on ...
2 parents 5fc3054 + 16adf5d commit 0e90ed0

File tree

22 files changed

+155
-134
lines changed

22 files changed

+155
-134
lines changed

MAINTAINERS

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,7 +1392,6 @@ F: include/linux/backlight.h
13921392
BATMAN ADVANCED
13931393
M: Marek Lindner <[email protected]>
13941394
M: Simon Wunderlich <[email protected]>
1395-
M: Sven Eckelmann <[email protected]>
13961395
13971396
W: http://www.open-mesh.org/
13981397
S: Maintained
@@ -1425,7 +1424,6 @@ S: Supported
14251424
F: arch/blackfin/
14261425

14271426
BLACKFIN EMAC DRIVER
1428-
M: Michael Hennerich <[email protected]>
14291427
14301428
W: http://blackfin.uclinux.org
14311429
S: Supported
@@ -1641,7 +1639,7 @@ CAN NETWORK LAYER
16411639
M: Oliver Hartkopp <[email protected]>
16421640
M: Oliver Hartkopp <[email protected]>
16431641
M: Urs Thuermann <[email protected]>
1644-
1642+
L: [email protected] (subscribers-only)
16451643
16461644
W: http://developer.berlios.de/projects/socketcan/
16471645
S: Maintained
@@ -1653,7 +1651,7 @@ F: include/linux/can/raw.h
16531651

16541652
CAN NETWORK DRIVERS
16551653
M: Wolfgang Grandegger <[email protected]>
1656-
1654+
L: [email protected] (subscribers-only)
16571655
16581656
W: http://developer.berlios.de/projects/socketcan/
16591657
S: Maintained
@@ -5183,6 +5181,7 @@ S: Supported
51835181
F: drivers/net/qlcnic/
51845182

51855183
QLOGIC QLGE 10Gb ETHERNET DRIVER
5184+
M: Jitendra Kalsaria <[email protected]>
51865185
M: Ron Mercer <[email protected]>
51875186
51885187

crypto/deflate.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <linux/interrupt.h>
3333
#include <linux/mm.h>
3434
#include <linux/net.h>
35-
#include <linux/slab.h>
3635

3736
#define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION
3837
#define DEFLATE_DEF_WINBITS 11
@@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
7372
int ret = 0;
7473
struct z_stream_s *stream = &ctx->decomp_stream;
7574

76-
stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
75+
stream->workspace = vzalloc(zlib_inflate_workspacesize());
7776
if (!stream->workspace) {
7877
ret = -ENOMEM;
7978
goto out;
@@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
8685
out:
8786
return ret;
8887
out_free:
89-
kfree(stream->workspace);
88+
vfree(stream->workspace);
9089
goto out;
9190
}
9291

@@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx)
9998
static void deflate_decomp_exit(struct deflate_ctx *ctx)
10099
{
101100
zlib_inflateEnd(&ctx->decomp_stream);
102-
kfree(ctx->decomp_stream.workspace);
101+
vfree(ctx->decomp_stream.workspace);
103102
}
104103

105104
static int deflate_init(struct crypto_tfm *tfm)

crypto/zlib.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <linux/interrupt.h>
3030
#include <linux/mm.h>
3131
#include <linux/net.h>
32-
#include <linux/slab.h>
3332

3433
#include <crypto/internal/compress.h>
3534

@@ -60,7 +59,7 @@ static void zlib_decomp_exit(struct zlib_ctx *ctx)
6059

6160
if (stream->workspace) {
6261
zlib_inflateEnd(stream);
63-
kfree(stream->workspace);
62+
vfree(stream->workspace);
6463
stream->workspace = NULL;
6564
}
6665
}
@@ -228,13 +227,13 @@ static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
228227
? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
229228
: DEF_WBITS;
230229

231-
stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
230+
stream->workspace = vzalloc(zlib_inflate_workspacesize());
232231
if (!stream->workspace)
233232
return -ENOMEM;
234233

235234
ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
236235
if (ret != Z_OK) {
237-
kfree(stream->workspace);
236+
vfree(stream->workspace);
238237
stream->workspace = NULL;
239238
return -EINVAL;
240239
}

drivers/net/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3416,7 +3416,8 @@ config NETCONSOLE
34163416

34173417
config NETCONSOLE_DYNAMIC
34183418
bool "Dynamic reconfiguration of logging targets"
3419-
depends on NETCONSOLE && SYSFS && CONFIGFS_FS
3419+
depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \
3420+
!(NETCONSOLE=y && CONFIGFS_FS=m)
34203421
help
34213422
This option enables the ability to dynamically reconfigure target
34223423
parameters (interface, IP addresses, port numbers, MAC addresses)

drivers/net/bnx2x/bnx2x_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <linux/zlib.h>
5050
#include <linux/io.h>
5151
#include <linux/stringify.h>
52+
#include <linux/vmalloc.h>
5253

5354
#define BNX2X_MAIN
5455
#include "bnx2x.h"
@@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
45374538
if (bp->strm == NULL)
45384539
goto gunzip_nomem2;
45394540

4540-
bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(),
4541-
GFP_KERNEL);
4541+
bp->strm->workspace = vmalloc(zlib_inflate_workspacesize());
45424542
if (bp->strm->workspace == NULL)
45434543
goto gunzip_nomem3;
45444544

@@ -4562,7 +4562,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
45624562
static void bnx2x_gunzip_end(struct bnx2x *bp)
45634563
{
45644564
if (bp->strm) {
4565-
kfree(bp->strm->workspace);
4565+
vfree(bp->strm->workspace);
45664566
kfree(bp->strm);
45674567
bp->strm = NULL;
45684568
}

drivers/net/can/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ config CAN_SLCAN
3636
config CAN_DEV
3737
tristate "Platform CAN drivers with Netlink support"
3838
depends on CAN
39-
default Y
39+
default y
4040
---help---
4141
Enables the common framework for platform CAN drivers with Netlink
4242
support. This is the standard library for CAN drivers.
@@ -45,7 +45,7 @@ config CAN_DEV
4545
config CAN_CALC_BITTIMING
4646
bool "CAN bit-timing calculation"
4747
depends on CAN_DEV
48-
default Y
48+
default y
4949
---help---
5050
If enabled, CAN bit-timing parameters will be calculated for the
5151
bit-rate specified via Netlink argument "bitrate" when the device

drivers/net/cxgb3/sge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
20262026
skb->ip_summed = CHECKSUM_UNNECESSARY;
20272027
} else
20282028
skb_checksum_none_assert(skb);
2029-
skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
2029+
skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
20302030

20312031
if (unlikely(p->vlan_valid)) {
20322032
struct vlan_group *grp = pi->vlan_grp;
@@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
21452145
if (!complete)
21462146
return;
21472147

2148-
skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
2148+
skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);
21492149

21502150
if (unlikely(cpl->vlan_valid)) {
21512151
struct vlan_group *grp = pi->vlan_grp;

drivers/net/ppp_deflate.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ static void z_decomp_free(void *arg)
305305

306306
if (state) {
307307
zlib_inflateEnd(&state->strm);
308-
kfree(state->strm.workspace);
308+
vfree(state->strm.workspace);
309309
kfree(state);
310310
}
311311
}
@@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
345345

346346
state->w_size = w_size;
347347
state->strm.next_out = NULL;
348-
state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
349-
GFP_KERNEL|__GFP_REPEAT);
348+
state->strm.workspace = vmalloc(zlib_inflate_workspacesize());
350349
if (state->strm.workspace == NULL)
351350
goto out_free;
352351

drivers/net/r8169.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
742742
msleep(2);
743743
for (i = 0; i < 5; i++) {
744744
udelay(100);
745-
if (!(RTL_R32(ERIDR) & ERIAR_FLAG))
745+
if (!(RTL_R32(ERIAR) & ERIAR_FLAG))
746746
break;
747747
}
748748

drivers/net/rionet.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev)
378378

379379
static void rionet_remove(struct rio_dev *rdev)
380380
{
381-
struct net_device *ndev = NULL;
381+
struct net_device *ndev = rio_get_drvdata(rdev);
382382
struct rionet_peer *peer, *tmp;
383383

384384
free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
@@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = {
433433
.ndo_set_mac_address = eth_mac_addr,
434434
};
435435

436-
static int rionet_setup_netdev(struct rio_mport *mport)
436+
static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
437437
{
438438
int rc = 0;
439-
struct net_device *ndev = NULL;
440439
struct rionet_private *rnet;
441440
u16 device_id;
442441

443-
/* Allocate our net_device structure */
444-
ndev = alloc_etherdev(sizeof(struct rionet_private));
445-
if (ndev == NULL) {
446-
printk(KERN_INFO "%s: could not allocate ethernet device.\n",
447-
DRV_NAME);
448-
rc = -ENOMEM;
449-
goto out;
450-
}
451-
452442
rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
453443
mport->sys_size ? __fls(sizeof(void *)) + 4 : 0);
454444
if (!rionet_active) {
@@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
504494
int rc = -ENODEV;
505495
u32 lpef, lsrc_ops, ldst_ops;
506496
struct rionet_peer *peer;
497+
struct net_device *ndev = NULL;
507498

508499
/* If local device is not rionet capable, give up quickly */
509500
if (!rionet_capable)
510501
goto out;
511502

503+
/* Allocate our net_device structure */
504+
ndev = alloc_etherdev(sizeof(struct rionet_private));
505+
if (ndev == NULL) {
506+
printk(KERN_INFO "%s: could not allocate ethernet device.\n",
507+
DRV_NAME);
508+
rc = -ENOMEM;
509+
goto out;
510+
}
511+
512512
/*
513513
* First time through, make sure local device is rionet
514514
* capable, setup netdev, and set flags so this is skipped
@@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
529529
goto out;
530530
}
531531

532-
rc = rionet_setup_netdev(rdev->net->hport);
532+
rc = rionet_setup_netdev(rdev->net->hport, ndev);
533533
rionet_check = 1;
534534
}
535535

@@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
546546
list_add_tail(&peer->node, &rionet_peers);
547547
}
548548

549+
rio_set_drvdata(rdev, ndev);
550+
549551
out:
550552
return rc;
551553
}

drivers/net/usb/kalmia.c

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,34 +100,42 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
100100
static int
101101
kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
102102
{
103-
char init_msg_1[] =
103+
const static char init_msg_1[] =
104104
{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
105105
0x00, 0x00 };
106-
char init_msg_2[] =
106+
const static char init_msg_2[] =
107107
{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
108108
0x00, 0x00 };
109-
char receive_buf[28];
109+
const static int buflen = 28;
110+
char *usb_buf;
110111
int status;
111112

112-
status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1)
113-
/ sizeof(init_msg_1[0]), receive_buf, 24);
113+
usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL);
114+
if (!usb_buf)
115+
return -ENOMEM;
116+
117+
memcpy(usb_buf, init_msg_1, 12);
118+
status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
119+
/ sizeof(init_msg_1[0]), usb_buf, 24);
114120
if (status != 0)
115121
return status;
116122

117-
status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2)
118-
/ sizeof(init_msg_2[0]), receive_buf, 28);
123+
memcpy(usb_buf, init_msg_2, 12);
124+
status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
125+
/ sizeof(init_msg_2[0]), usb_buf, 28);
119126
if (status != 0)
120127
return status;
121128

122-
memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN);
129+
memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN);
123130

131+
kfree(usb_buf);
124132
return status;
125133
}
126134

127135
static int
128136
kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
129137
{
130-
u8 status;
138+
int status;
131139
u8 ethernet_addr[ETH_ALEN];
132140

133141
/* Don't bind to AT command interface */
@@ -190,7 +198,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
190198
dev_kfree_skb_any(skb);
191199
skb = skb2;
192200

193-
done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
201+
done:
202+
header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
194203
ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
195204
ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];
196205

@@ -201,9 +210,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
201210
header_start[0] = 0x57;
202211
header_start[1] = 0x44;
203212
content_len = skb->len - KALMIA_HEADER_LENGTH;
204-
header_start[2] = (content_len & 0xff); /* low byte */
205-
header_start[3] = (content_len >> 8); /* high byte */
206213

214+
put_unaligned_le16(content_len, &header_start[2]);
207215
header_start[4] = ether_type_1;
208216
header_start[5] = ether_type_2;
209217

@@ -231,13 +239,13 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
231239
* Our task here is to strip off framing, leaving skb with one
232240
* data frame for the usbnet framework code to process.
233241
*/
234-
const u8 HEADER_END_OF_USB_PACKET[] =
242+
const static u8 HEADER_END_OF_USB_PACKET[] =
235243
{ 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
236-
const u8 EXPECTED_UNKNOWN_HEADER_1[] =
244+
const static u8 EXPECTED_UNKNOWN_HEADER_1[] =
237245
{ 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
238-
const u8 EXPECTED_UNKNOWN_HEADER_2[] =
246+
const static u8 EXPECTED_UNKNOWN_HEADER_2[] =
239247
{ 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
240-
u8 i = 0;
248+
int i = 0;
241249

242250
/* incomplete header? */
243251
if (skb->len < KALMIA_HEADER_LENGTH)
@@ -285,7 +293,7 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
285293

286294
/* subtract start header and end header */
287295
usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
288-
ether_packet_length = header_start[2] + (header_start[3] << 8);
296+
ether_packet_length = get_unaligned_le16(&header_start[2]);
289297
skb_pull(skb, KALMIA_HEADER_LENGTH);
290298

291299
/* Some small packets misses end marker */

0 commit comments

Comments
 (0)