[patch -next] cavium/liquidio: fix some error handling in lio_set_phys_id()

2015-06-24 Thread Dan Carpenter
There was a missing assignment so the if (ret) on the next line is never true. Fixes: f21fb3ed364b ('Add support of Cavium Liquidio ethernet adapters') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/cavium/liquidio/lio_ethtool.c b/drivers/net/ethernet

[patch -next] renesas: missing unlock on error path

2015-06-24 Thread Dan Carpenter
We need to unlock before returning here. Fixes: a0d2f20650e8 ('Renesas Ethernet AVB PTP clock driver') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/renesas/ravb_ptp.c b/drivers/net/ethernet/renesas/ravb_ptp.c index 42656da..7a8ce92 100644 --- a/drivers

[patch -next] net/mlx5_core: fix an error code

2015-06-11 Thread Dan Carpenter
We return success if mlx5e_alloc_sq_db() fails but we should return an error code. Fixes: f62b8bb8f2d3 ('net/mlx5: Extend mlx5_core to support ConnectX-4 Ethernet functionality') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c

Re: [PATCH net-next 1/1] hv_netvsc: Properly size the vrss queues

2015-05-28 Thread Dan Carpenter
. You could just leave the num_ out. Almost all variables are numbers in C so it doesn't add anything. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

Re: [PATCH net-next 1/1] hv_netvsc: Properly size the vrss queues

2015-05-28 Thread Dan Carpenter
On Thu, May 28, 2015 at 01:52:47PM +, KY Srinivasan wrote: -Original Message- From: Dan Carpenter [mailto:dan.carpen...@oracle.com] Sent: Thursday, May 28, 2015 12:06 AM To: KY Srinivasan Cc: da...@davemloft.net; netdev@vger.kernel.org; linux- ker...@vger.kernel.org; de

Re: [PATCH net-next] hv_netvsc: Add support to set MTU reservation from guest side

2015-07-03 Thread Dan Carpenter
ETH_DATA_LEN || mtu limit) + if (mtu 68 || mtu limit) How did you calculate 68? Avoid magic numbers like this, make it a define. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More

Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-25 Thread Dan Carpenter
through the normal review process. The intern process is over this year. The lack of normal review introduced a number of bugs this year. I always complain to Greg about it and he says that I should join the intern mailing list if I care so much. regards, dan carpenter -- To unsubscribe from this list

Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-25 Thread Dan Carpenter
I'm annoyed already since we have been dealing with the fallout for months and I always make sure to complain whenever I have a chance. /me shakes a fist! Grrr :P regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord

Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-26 Thread Dan Carpenter
as a favour to us. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-26 Thread Dan Carpenter
is easy to delete. Or even just apply them first, and we tell people to send follow on patches or revert as needed. My whole setup revolves around email so finding and reviewing patches using git log is awkward. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH] staging: r8712u: Fix kernel warning for improper call of del_timer_sync()

2015-05-26 Thread Dan Carpenter
, it never went through the list. I'm fine with 5 bugs per 900 patches or whatever. I wish that the patches came to the list, but I get that that would double your review workload to review 900 patches on the outreachy list and again on the normal dev list. regards, dan carpenter -- To unsubscribe

[patch 1/2 -mainline] cxgb4: missing curly braces in t4_setup_debugfs()

2015-08-08 Thread Dan Carpenter
There were missing curly braces so it means we call add_debugfs_mem() unintentionally. Fixes: 3ccc6cf74d8c ('cxgb4: Adds support for T6 adapter') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio

[patch 2/2] cxgb4: cleanup some indenting

2015-08-08 Thread Dan Carpenter
Add or remove some tabs so that statements line up correctly. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index 9e0b670..b83ca7f 100644 --- a/drivers/net/ethernet

[patch] cosa: missing error code on failure in probe()

2015-08-12 Thread Dan Carpenter
If register_hdlc_device() fails, the current code returns 0 but we should return an error code instead. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 7193b73..848ea6a 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net

[patch] cxgb4: memory corruption in debugfs

2015-08-18 Thread Dan Carpenter
You can't use kstrtoul() with an int or it causes memory corruption. Also j should be unsigned or we have underflow bugs. I considered changing j to unsigned long but everything fits in a u32. Fixes: 8e3d04fd7d70 ('cxgb4: Add MPS tracing support') Signed-off-by: Dan Carpenter dan.carpen

Re: [patch] cxgb4: memory corruption in debugfs

2015-08-18 Thread Dan Carpenter
On Tue, Aug 18, 2015 at 07:28:53PM +0900, Tetsuo Handa wrote: Dan Carpenter wrote: You can't use kstrtoul() with an int or it causes memory corruption. Also j should be unsigned or we have underflow bugs. I considered changing j to unsigned long but everything fits in a u32. Excuse me

Re: [patch -master] netfilter: xt_CT: checking for IS_ERR() instead of NULL

2015-07-30 Thread Dan Carpenter
On Thu, Jul 30, 2015 at 01:57:43PM +0200, Pablo Neira Ayuso wrote: I have also appended this chunk, since synproxy is also affected: Thanks. I have rechecked my scripts and I *should* have caught that. I'm not sure what went wrong... regards, dan carpenter -- To unsubscribe from this list

[patch] rds: fix an integer overflow test in rds_info_getsockopt()

2015-08-01 Thread Dan Carpenter
but it seems safe to limit len to INT_MAX - 4095. Fixes: a8c879a7ee98 ('RDS: Info and stats') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/rds/info.c b/net/rds/info.c index 9a6b4f6..140a44a 100644 --- a/net/rds/info.c +++ b/net/rds/info.c @@ -176,7 +176,7 @@ int rds_info_getsockopt

re: af_mpls: fix undefined reference to ip6_route_output

2015-08-04 Thread Dan Carpenter
err = PTR_ERR(dev); 454 dev = NULL; 455 goto errout; 456 } regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http

[patch] mpls: small cleanup in inet/inet6_fib_lookup_dev()

2015-08-04 Thread Dan Carpenter
. There is no cleanup necessary so I changed the gotos to direct returns. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index 88cfaa2..d933059 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -337,14 +337,14 @@ static unsigned

[patch -next] bpf: off by one in check_map_func_compatibility()

2015-08-13 Thread Dan Carpenter
The loop iterates one space too far, so we might read beyond the end of the func_limit[] array. Fixes: 35578d798400 ('bpf: Implement function bpf_perf_event_read() that get the selected hardware PMU conuter') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/kernel/bpf

[patch] net: ethernet: micrel: fix an error code

2015-08-14 Thread Dan Carpenter
The dma_mapping_error() function returns true or false. We should return -ENOMEM if it there is a dma mapping error. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c index f78909a..09d2e16 100644

[patch] hamradio/kiss: missing error code in mkiss_open()

2015-08-10 Thread Dan Carpenter
If register_netdev() fails we return success but we should return an error code instead. Reported-by: RUC_Soft_Sec zy900...@163.com Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 2ffbf13..dcb6bb7 100644

[patch -master] netfilter: xt_CT: checking for IS_ERR() instead of NULL

2015-07-27 Thread Dan Carpenter
We recently changed this from nf_conntrack_alloc() to nf_ct_tmpl_alloc() so the error handling needs to changed to check for NULL instead of IS_ERR(). Fixes: 0838aa7fcfcd ('netfilter: fix netns dependencies with conntrack templates') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff

[patch] packet: missing dev_put() in packet_do_bind()

2015-07-27 Thread Dan Carpenter
changed on a bind. Fixes: 902fefb82ef7 ('packet: improve socket create/bind latency in some cases') Signed-off-by: Lars Westerhoff lars.westerh...@newtec.eu Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Daniel Borkmann dbork...@redhat.com diff --git a/net/packet/af_packet.c b/net

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-24 Thread Dan Carpenter
this morning and they all seem fine... regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch -next] lwtunnel: use kfree_skb() instead of vanilla kfree()

2015-07-27 Thread Dan Carpenter
kfree_skb() is correct here. Fixes: ffce41962ef6 ('lwtunnel: support dst output redirect function') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/net/core/lwtunnel.c b/net/core/lwtunnel.c index bb58826..5f7fae7 100644 --- a/net/core/lwtunnel.c +++ b/net/core/lwtunnel.c

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-22 Thread Dan Carpenter
instead. if (ret != 0 != 0) return ret; regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-23 Thread Dan Carpenter
instead of the ret. Hi Dan, I read this as a humor. :-) :) regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH V3 3/7] Drivers: hv: vmbus: add APIs to send/recv hvsock packet and get the r/w-ability

2015-07-23 Thread Dan Carpenter
On Thu, Jul 23, 2015 at 01:10:57PM +0300, Dan Carpenter wrote: In this specific case, writing it as if (ret != 0) caused the bug. If we had written it as if (ret) return ret; then there are no zeroes so wouldn't have been any temptation to return the zero instead of the ret. I did a search

Re: [patch] netlink: fix a limit in NETLINK_LIST_MEMBERSHIPS

2015-11-13 Thread Dan Carpenter
Oh. Crap... My mistake. Sorry for the noise. The original code is fine. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch -next] qlogic: qed: fix error codes in qed_resc_alloc()

2015-11-05 Thread Dan Carpenter
We accidentally return success instead of -ENOMEM here. Fixes: fe56b9e6a8d9 ('qed: Add module with basic common support') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index b

[patch -next] qlogic: qed: fix a test for MODE_MF_SI

2015-11-04 Thread Dan Carpenter
MODE_MF_SI is 9. We should be testing bit 9 instead of AND 0x9. Fixes: fe56b9e6a8d9 ('qed: Add module with basic common support') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c

[patch -next] qlogic/qed: remove bogus NULL check

2015-11-04 Thread Dan Carpenter
We check if "p_hwfn" is NULL and then dereference it in the error handling code. I read the code and it isn't NULL so let's remove the check. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qed/qed_int.c b/drivers/net/eth

Re: [PATCH 1/2] NFC: delete null dereference

2015-10-19 Thread Dan Carpenter
064 nfc_put_device(dev); It should not call nfc_put_device() because that happens after goto exit. 1065 rc = -ENODEV; 1066 goto exit; 1067 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscrib

[patch] irda: precedence bug in irlmp_seq_hb_idx()

2015-10-19 Thread Dan Carpenter
This is decrementing the pointer, instead of the value stored in the pointer. KASan detects it as an out of bounds reference. Reported-by: "Berry Cheng 程君(成淼)" <chengmiao...@alibaba-inc.com> Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- This bug predates

[patch] net/xen-netback: off by one in BUG_ON() condition

2015-07-11 Thread Dan Carpenter
The should be =. I also added spaces around the '-' operations so the code is a little more consistent and matches the condition better. Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com diff --git a/drivers/net/xen-netback

[patch] netlink: fix a limit in NETLINK_LIST_MEMBERSHIPS

2015-11-13 Thread Dan Carpenter
k: add API to retrieve all group memberships') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 59651af..76a8466 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2373,7 +2373,7 @@ static int ne

re: fjes: update_zone_task

2015-09-13 Thread Dan Carpenter
line 970 to a break and delete lines 1016 and 1017? 1018 1019 break; 1020 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch - Nicholas's tree] netconsole: Missing unlock on error path

2015-10-03 Thread Dan Carpenter
We added new locking to this function but we missed one error path which needs an unlock. Fixes: cdacad4993f4 ('netconsole: use per-attribute show and store methods') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- This is going through Nicholas Bellinger's tree not net-next.

re: net: mvpp2: fix missing DMA region unmap in egress processing

2015-12-08 Thread Dan Carpenter
dev_kfree_skb_any(skb); 4417 } 4418 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[patch -next] VSOCK: signedness bug in virtio_transport_dgram_enqueue()

2015-12-09 Thread Dan Carpenter
"written" has to be signed for the error handling to work. trans->ops->send_pkt() returns an int so that's fine. Fixes: 80a19e338d45 ('VSOCK: Introduce virtio-vsock-common.ko') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/vmw_vsock/virtio_tra

[patch -next] mlxsw: spectrum: fix some error handling

2015-12-09 Thread Dan Carpenter
The "err = " assignment is missing here. Fixes: 0d65fc13042f ('mlxsw: spectrum: Implement LAG port join/leave') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum

[patch -next] mlxsw: core: remove an unneeded condition

2015-12-09 Thread Dan Carpenter
We already know "err" is zero so there is no need to check. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c b/drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c index 4dad146..913106d 100644 --- a/drivers/net/e

Re: [patch v2] qlcnic: fix a timeout loop

2015-12-15 Thread Dan Carpenter
On Tue, Dec 15, 2015 at 11:13:50PM +0300, Dan Carpenter wrote: > On Tue, Dec 15, 2015 at 01:13:41PM -0500, David Miller wrote: > > From: Dan Carpenter <dan.carpen...@oracle.com> > > Date: Tue, 15 Dec 2015 16:56:16 +0300 > > > > > The problem here is

Re: [patch v2] qlcnic: fix a timeout loop

2015-12-15 Thread Dan Carpenter
On Tue, Dec 15, 2015 at 01:13:41PM -0500, David Miller wrote: > From: Dan Carpenter <dan.carpen...@oracle.com> > Date: Tue, 15 Dec 2015 16:56:16 +0300 > > > The problem here is that at the end of the loop we test for if > > idc->vnic_wait_limit is zero,

[patch] mISDN: fix a loop count

2015-12-15 Thread Dan Carpenter
e end with cnt set to 0. Fixes: cae86d4a4e56 ('mISDN: Add driver for Infineon ISDN chipset family') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/isdn/hardware/mISDN/mISDNipac.c b/drivers/isdn/hardware/mISDN/mISDNipac.c index a77eea5..cb428b9 100644 --- a/dri

[patch] qlcnic: fix a timeout loop

2015-12-15 Thread Dan Carpenter
_TIMEO" (30) to "QLCNIC_DEV_NPAR_OPER_TIMEO + 1" so that we still loop the same number of times as before. Fixes: 486a5bc77a4a ('qlcnic: Add support for 83xx suspend and resume.') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlo

[patch -mainline] qlge: fix a timeout loop in ql_change_rx_buffers()

2015-12-15 Thread Dan Carpenter
The problem here is that after the loop we test for "if (!i) " but because "i--" is a post-op we exit with i set to -1. I have fixed this by changing it to a pre-op instead. I had to change the starting value from 3 to 4 so that we still iterate 3 times. Signed-off-by: Dan C

[patch -mainline] sfc: fix a timeout loop

2015-12-15 Thread Dan Carpenter
We test for if "tries" is zero at the end but "tries--" is a post-op so it will end with "tries" set to -1. I have changed it to a pre-op instead. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/sfc/txc431

[patch -mainline] amd-xgbe: fix a couple timeout loops

2015-12-15 Thread Dan Carpenter
At the end of the loop we test "if (!count)" but because "count--" is a post-op then the loop will end with count set to -1. I have fixed this by changing it to --count. Fixes: c5aa9e3b8156 ('amd-xgbe: Initial AMD 10GbE platform driver') Signed-off-by: Dan Carpenter <d

[patch v2] qlcnic: fix a timeout loop

2015-12-15 Thread Dan Carpenter
uspend and resume.') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- v2: different color on the bikeshed diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c index be7d7a6..b1a452f 100644 --- a/drivers/net/eth

re: [PATCH] chelsio: add support for other 10G boards

2015-12-14 Thread Dan Carpenter
RTISED_ASYM_PAUSE; 635 if (fc == PAUSE_RX) 636 lc->advertising |= ADVERTISED_PAUSE; 637 } 638 } 639 phy->ops->advertise(phy, lc->advertising); regard

Re: [PATCH 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt()

2016-01-04 Thread Dan Carpenter
is the correct thing but it's not "worthwhile". It is not a good use of my time. Please stop sending cleanup patches, Markus. Just send fixes. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@

Re: [PATCH 0/5] xen-netback: Fine-tuning for three function implementations

2016-01-04 Thread Dan Carpenter
The original code is fine. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt()

2016-01-04 Thread Dan Carpenter
le and they go against the author's original intention. I tend to agree that useless initializers are bad and disable GCCs uninitialized variable warnings but just because I agree with you doesn't make it official kernel style. It's slightly rude to go against the author's intention. regards, dan carp

Re: [PATCH 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt()

2016-01-04 Thread Dan Carpenter
omplicated (that's actually what caused the bug in this patch, in fact). regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/3] rsi: Delete unnecessary variable initialisations in rsi_send_mgmt_pkt()

2016-01-04 Thread Dan Carpenter
On Mon, Jan 04, 2016 at 02:17:40PM +0100, Bjørn Mork wrote: > Dan Carpenter <dan.carpen...@oracle.com> writes: > > > Please stop sending cleanup patches, Markus. Just send fixes. > > Thanks for your continued but unwarranted belief in AI. > I always tell peopl

[patch -next] mlxsw: core: remove an unnecessary condition

2016-01-06 Thread Dan Carpenter
We checked "err" on the lines before so we know it's zero here. These cause a static checker warning because checking known things can indicate a bug. Maybe there is a missing assignment or we are checking the wrong variable. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com

[patch -next] fsl/fman: fix the pause_time test

2016-01-06 Thread Dan Carpenter
pause_time is unsigned so it can't be less than zero. The bug means that we allow invalid pause-times. Fixes: 57ba4c9b56d8 ('fsl/fman: Add FMan MAC support') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/freescale/fman/fman_dtsec.c b/drive

[patch -next] fsl/fman: use the ALIGN() macro

2016-01-06 Thread Dan Carpenter
the bitwise negate. It's cleaner to use the kernel's ALIGN() macro instead. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- I think this patch is correct, but I haven't tested it, so please review carefully. diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.c b/drivers/net/et

[patch -next] fsl/fman: double free on probe failure

2016-01-06 Thread Dan Carpenter
"priv" is allocated with devm_kzalloc() so freeing it here with kfree() will lead to a double free. Fixes: 3933961682a3 ('fsl/fman: Add FMan MAC driver') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/driv

Re: [patch v2] qlcnic: fix a timeout loop

2016-01-05 Thread Dan Carpenter
No. This patch is a suspend resume thing and your bug is something else. Honestly, this patch is a static checker fix and I doubt it has much real worl impact at all. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message

Re: [patch -next] fsl/fman: use the ALIGN() macro

2016-01-06 Thread Dan Carpenter
On Wed, Jan 06, 2016 at 03:27:38PM -0500, David Miller wrote: > From: Dan Carpenter <dan.carpen...@oracle.com> > Date: Wed, 6 Jan 2016 13:03:08 +0300 > > > diff --git a/drivers/net/ethernet/freescale/fman/fman_sp.c > > b/drivers/net/ethernet/freescale/fman/fman_sp.c

[patch] qlcnic: fix a loop exit condition better

2015-12-24 Thread Dan Carpenter
In the original code, if we succeeded on the last iteration through the loop then we still returned failure. Fixes: 389e4e04ad2d ('qlcnic: fix a timeout loop') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c b/d

Re: [PATCH 1/4] staging: rtl8712: Remove casts between void * and type *

2015-11-24 Thread Dan Carpenter
On Tue, Nov 24, 2015 at 10:19:39AM -0200, Mauro Dreissig wrote: > Cleaning rtl871x_ioctl_rtl.c. > It's better if you think about the header and the body as two different things. Just repeat the title but with more information. regards, dan carpenter -- To unsubscribe from this list

[patch] net/hsr: fix a warning message

2015-11-21 Thread Dan Carpenter
WARN_ON_ONCE() takes a condition, it doesn't take an error message. I have converted this to WARN() instead. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c index 35a9788..c7d1adc 100644 --- a/net/hsr/hsr_device.c +++ b/n

[patch -next] qed: potential overflow in qed_cxt_src_t2_alloc()

2016-06-07 Thread Dan Carpenter
could lead to memory corruption. Fixes: dbb799c39717 ('qed: Initialize hardware for new protocols') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qed/qed_cxt.c b/drivers/net/ethernet/qlogic/qed/qed_cxt.c index d85b7ba..1c35f37 100644 --- a/d

[patch] atm: iphase: off by one in rx_pkt()

2016-05-27 Thread Dan Carpenter
The iadev->rx_open[] array holds "iadev->num_vc" pointers (this code assumes that pointers are 32 bits). So the > here should be >= or else we could end up reading a garbage pointer from one element beyond the end of the array. Signed-off-by: Dan Carpenter <dan.carpen..

[patch] atm: firestream: add more reserved strings

2016-05-27 Thread Dan Carpenter
rly in the 30 40 range. I added them as reserved 37 to reserved 40. It's possible that strings are really supposed to be added in the middle instead of at the end, but this approach is safe, in that it fixes the bug and doesn't break anything that wasn't already broken. Signed-off-by: Dan Carpen

[patch] ptp: oops in ptp_ioctl()

2016-05-26 Thread Dan Carpenter
If we pass ERR_PTR(-EFAULT) to kfree() then it's going to oops. Fixes: 2ece068e1b1d ('ptp: use memdup_user().') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c index 0b1ac6b..d637c93 100644 --- a/drivers/ptp/ptp_cha

[patch -next] tipc: potential shift wrapping bug in map_set()

2016-06-17 Thread Dan Carpenter
"up_map" is a u64 type but we're not using the high 32 bits. Fixes: 35c55c9877f8 ('tipc: add neighbor monitoring framework') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c index 87d4efe..0d489e8 100644 --- a/net/tipc

[patch 3/3 -mainline] liquidio: off by one in liquidio_set_mcast_list()

2016-06-18 Thread Dan Carpenter
of Cavium Liquidio ethernet adapters') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index 1126422..41ee8bd 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c +

[patch 2/3] liquidio: remove an unused variable

2016-06-18 Thread Dan Carpenter
We don't use "i" in this function. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index 715ddfa..1126422 100644 --- a/drivers/net/ethernet/cavium/liquidio/

[patch 1/3 -next] liquidio: a couple indenting tweaks

2016-06-18 Thread Dan Carpenter
Remove a stray space character and fix an if statement that wasn't indented. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Speaking of style issues, this whole file follows return 1 on error and 0 on success. It was confusing for me. It's not too late to change it to use c

[patch net-next] rxrpc: checking for IS_ERR() instead of NULL

2016-06-18 Thread Dan Carpenter
rxrpc_lookup_peer_rcu() returns NULL on error, it never returns error pointers. Fixes: be6e6707f6ee ('rxrpc: Rework peer object handling to use hash table and RCU') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/rxrpc/input.c b/net/rxrpc/input.c index 47fb167..e

[patch] qlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag()

2016-06-27 Thread Dan Carpenter
x data path routines') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Not tested. diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 7bd6f25..607bb7d 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c

[patch] rocker: fix rocker_world_port_obj_vlan_add()

2016-02-23 Thread Dan Carpenter
We were changing return values and accidentally made rocker_world_port_obj_vlan_add() into a no-op. Fixes: fccd84d44912 ('rocker: return -EOPNOTSUPP for undefined world ops') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/d

[patch] rocker: fix an error code

2016-02-27 Thread Dan Carpenter
We intended to return PTR_ERR() here instead of 1. Fixes: 1f9993f6825f ('rocker: fix a neigh entry leak issue') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- We recently moved rocker files around so this only applies to -next. Probably returning the wrong error code is ha

[patch 1/2 net-next] mediatek: checking for IS_ERR() instead of NULL

2016-03-15 Thread Dan Carpenter
of_phy_connect() returns NULL on error, it never returns error pointers. Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/me

[patch 2/2 net-next] mediatek: unlock on error in mtk_tx_map()

2016-03-15 Thread Dan Carpenter
There was a missing unlock on the error path. Fixes: 656e705243fd ('net-next: mediatek: add support for MT7623 ethernet') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index 9

[patch] ethernet: micrel: fix some error codes

2016-03-16 Thread Dan Carpenter
ret;" for clarity. Fixes: 94fe8c683cea ('ks8842: Support DMA when accessed via timberdale') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c index 09d2e16..cb0102d 100644 --- a/drivers/net/et

Re: Inconsistent use of size argument in kzalloc and memcpy in 'drivers/net/ethernet/toshiba/ps3_gelic_wireless.c'

2016-04-11 Thread Dan Carpenter
'. > This is not consistent. > Good catch. be16_to_cpu(scan_info->size) is correct. It's surprising that this bug wasn't caught in testing... regards, dan carpenter

[patch] mdio-sun4i: oops in error handling in probe

2016-03-21 Thread Dan Carpenter
We could end up dereferencing an error pointer when we call regulator_disable(). Fixes: 4bdcb1dd9feb ('net: Add MDIO bus driver for the Allwinner EMAC') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/phy/mdio-sun4i.c b/drivers/net/phy/mdio-sun4i.c index f

[patch] libertas: fix an error code in probe

2016-03-08 Thread Dan Carpenter
We accidentally return success instead of a negative error code. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c index b35b8bc..8541cbe 100644 --- a/drivers/net/wireless/m

Re: [patch] net: moxa: fix an error code

2016-03-02 Thread Dan Carpenter
h + index)); return error; then Smatch still breaks that up into two separate returns which imply initialized vs uninitialized. regards, dan carpenter

Re: [patch] net: moxa: fix an error code

2016-03-02 Thread Dan Carpenter
one where I could have done that but I deliberately didn't because I wanted the uninitialized warning if I made a mistake. It sounds like you're working around a GCC bug... regards, dan carpenter

[patch] net: moxa: fix an error code

2016-03-02 Thread Dan Carpenter
We accidentally return IS_ERR(priv->base) which is 1 instead of PTR_ERR(priv->base) which is the error code. Fixes: 6c821bd9edc9 ('net: Add MOXA ART SoCs ethernet driver') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b

[patch] tipc: remove an unnecessary NULL check

2016-04-27 Thread Dan Carpenter
This is never called with a NULL "buf" and anyway, we dereference 's' on the lines before so it would Oops before we reach the check. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/net/tipc/subscr.c b/net/tipc/subscr.c index 79de588..0dd0224 100644 --- a/n

[patch] qed: signedness bug in qed_dcbx_process_tlv()

2016-05-23 Thread Dan Carpenter
"priority" needs to be signed for the error handling to work. Fixes: 39651abd2814 ('qed: add support for dcbx.') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> --- Applies to the main net tree. diff --git a/drivers/net/ethernet/qlogic/qed/qed_dcbx.c b/drivers/net/eth

[patch -mainline] qlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template()

2016-05-10 Thread Dan Carpenter
If qlcnic_fw_cmd_get_minidump_temp() fails then "fw_dump->tmpl_hdr" is NULL or possibly freed. It can lead to an oops later. Fixes: d01a6d3c8ae1 ('qlcnic: Add support to enable capability to extend minidump for iSCSI') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.

[patch v2] qed: Remove a stray tab

2016-05-17 Thread Dan Carpenter
This line was indented more than it should be. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Acked-by: Yuval Mintz <yuval.mi...@qlogic.com> --- v2: fix a typo diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 6ffc

[patch] qed: Remove a stray tab

2016-05-17 Thread Dan Carpenter
This line was intended more than it should be. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qed/qed_main.c b/drivers/net/ethernet/qlogic/qed/qed_main.c index 6ffc21d..05fcb25 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_main.c

re: drivers: net: xgene: fix statistics counters race condition

2016-05-17 Thread Dan Carpenter
r(rx_ring, netdev_priv(rx_ring->ndev), 491 status); 492 ret = -EIO; 493 goto out; 494 } regards, dan carpenter

re: iwlwifi: mvm: add reorder buffer per queue

2016-05-13 Thread Dan Carpenter
hecked dereference inside the function call. 913 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); 914 rcu_read_unlock(); 915 } regards, dan carpenter

[patch] qede: uninitialized variable in qede_start_xmit()

2016-05-05 Thread Dan Carpenter
"data_split" was never set to false. It's just uninitialized. Fixes: 2950219d87b0 ('qede: Add basic network device support') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/q

[patch 2/2] netxen: reversed condition in netxen_nic_set_link_parameters()

2016-05-05 Thread Dan Carpenter
My static checker complains that we are using "autoneg" without initializing it. The problem is the ->phy_read() condition is reversed so we only set this on error instead of success. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/eth

[patch] i40e: fix an uninitialized variable bug

2016-05-05 Thread Dan Carpenter
We removed this initialization but it is required. Let's put it back. Fixes: 895106a577c4 ('i40e: trivial fixes') Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/intel/i40e/i40e_hmc.c b/drivers/net/ethernet/intel/i40e/i40e_hmc.c index 5ebe12d..a

[patch 1/2] netxen: fix error handling in netxen_get_flash_block()

2016-05-05 Thread Dan Carpenter
My static checker complained that "v" can be used unintialized if netxen_rom_fast_read() returns -EIO. That function never actually returns -1. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c b/drivers/net

[patch] netxen: netxen_rom_fast_read() doesn't return -1

2016-05-05 Thread Dan Carpenter
The error handling is broken here. netxen_rom_fast_read() returns zero on success and -EIO on error. It never returns -1. Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/

  1   2   3   4   >