AW: [PATCH] net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs'

2020-10-15 Thread Walter Harms
if xprt->debugfs->d_name.name can be what ever long it is more clever to use kasprintf() the some for link (no idea how many xprt als possible) jm2c wh Von: Fedor Tokarev [ftoka...@gmail.com] Gesendet: Donnerstag, 15. Oktober 2020 15:59 An: bfie...@field

AW: [PATCH 1/2 v3] net: ethernet: ti: fix some return value check of cpsw_ale_create()

2020-05-20 Thread Walter Harms
just a notice: from my casual observation i noticed that most people expect a function to return NULL on error (as seen here). So i would suggest to return NULL and (if needed) the error code otherwise. jm2c, re wh Von: kernel-janitors-ow...@vger.kernel.o

AW: [PATCH] rtlwifi: rtl8192ee: remove redundant for-loop

2020-05-15 Thread Walter Harms
if someone has same spare time, this driver need a bit more love ... SO far i can see in rtl92ee_phy_iq_calibrate: * IQK_MATRIX_REG_NUM should be used instead 8 hardcoded. * the for-loop in the beginning is obfuscating that it sets simply final_candidate this can be cleaned: reg_e94 = res

AW: [PATCH] net: dsa: sja1105: fix speed setting for 10 MBPS

2020-05-01 Thread Walter Harms
IMHO it would be better to use switch case here to improve readability. switch (bmcr & mask) { case BMCR_SPEED1000: speed = SPEED_1000; break; case BMCR_SPEED100: speed = SPEED_100;

Re: [PATCH v3] net: ns83820: code cleanup for ns83820_probe_phy()

2019-02-19 Thread walter harms
Am 19.02.2019 10:06, schrieb Mao Wenan: > This patch is to do code cleanup for ns83820_probe_phy(). > It deletes unused variable 'first' and commented out code. > > Signed-off-by: Mao Wenan > --- > v2->v3: delte unused variable 'first'; change subject from > "net: ns83820: drop pointless st

Re: [PATCH v3] net: ns83820: code cleanup for ns83820_probe_phy()

2019-02-19 Thread Walter Harms
Am 19.02.2019 10:06, schrieb Mao Wenan: > This patch is to do code cleanup for ns83820_probe_phy(). > It deletes unused variable 'first' and commented out code. > > Signed-off-by: Mao Wenan > --- > v2->v3: delte unused variable 'first'; change subject from > "net: ns83820: drop pointless sta

Re: [PATCH v3 04/21] ppp: exit_net cleanup checks added

2017-11-06 Thread walter harms
Hello Vasily Averin, just a general hint: when you send new versions of a patch please document also what you have changed. Here an example from an other ML: The problematic code looks like this: res_seq = res_hdr->xd_hdr.length_sn & TB_XDOMAIN_SN_MASK; res_seq >>= TB_XDOMAIN_SN_S

Re: [PATCH] wan: wanxl: remove redundant assignment to stat

2017-11-01 Thread walter harms
Am 01.11.2017 09:49, schrieb Colin King: > From: Colin Ian King > > stat set to zero and the value is never read, instead stat is > set again in the do-loop. Hence the setting to zero is redundant > and can be removed. Cleans up clang warning: > > drivers/net/wan/wanxl.c:737:2: warning: Value

Re: [PATCH 2/2] net: netrom: refactor code in nr_add_node

2017-10-20 Thread walter harms
Am 20.10.2017 18:06, schrieb Gustavo A. R. Silva: > Hi Walter, > > Quoting walter harms : > >> Am 19.10.2017 19:27, schrieb Gustavo A. R. Silva: >>> Code refactoring in order to make the code easier to read and maintain. >>> >>> Signed-off-by: G

Re: [PATCH 2/2] net: netrom: refactor code in nr_add_node

2017-10-20 Thread walter harms
Am 19.10.2017 19:27, schrieb Gustavo A. R. Silva: > Code refactoring in order to make the code easier to read and maintain. > > Signed-off-by: Gustavo A. R. Silva > --- > This code was tested by compilation only (GCC 7.2.0 was used). > > net/netrom/nr_route.c | 63 > -

Re: [PATCH] netfilter: fix indent on in statements

2017-08-15 Thread walter harms
Am 15.08.2017 08:50, schrieb Colin King: > From: Colin Ian King > > The returns on some if statements are not indented correctly, > add in the missing tab. > > Signed-off-by: Colin Ian King > --- > net/bridge/netfilter/ebt_ip.c | 4 ++-- > net/bridge/netfilter/ebt_ip6.c | 2 +- > 2 files ch

Re: [PATCH] hdlcdrv: fix divide error bug if bitrate is 0

2017-05-17 Thread walter harms
Am 17.05.2017 15:42, schrieb Firo Yang: > On Wed, May 17, 2017 at 02:59:39PM +0200, walter harms wrote: >> >> >> Am 17.05.2017 14:35, schrieb Firo Yang: >>> The divisor s->par.bitrate will always be 0 until initialized by >>> ndo_open() and hdlcdrv_o

Re: [PATCH] hdlcdrv: fix divide error bug if bitrate is 0

2017-05-17 Thread walter harms
Am 17.05.2017 14:35, schrieb Firo Yang: > The divisor s->par.bitrate will always be 0 until initialized by > ndo_open() and hdlcdrv_open(). > > In order to fix this divide zero error, check whether the netdevice > was opened by ndo_open() before performing divide. > > Reported-by: Dmitry Vyukov

Re: [PATCH] net/sched: remove redundant null check on head

2017-05-03 Thread walter harms
Am 03.05.2017 15:50, schrieb Colin King: > From: Colin Ian King > > head is previously null checked and so the 2nd null check on head > is redundant and therefore can be removed. > > Detected by CoverityScan, CID#1399505 ("Logically dead code") > > Signed-off-by: Colin Ian King > --- > net/

Re: [PATCH] Add checks for kmalloc allocation failures

2017-03-29 Thread walter harms
Am 29.03.2017 17:54, schrieb Colin King: > From: Colin Ian King > > Ensure we don't end up with a null pointer dereferences by checking > for for allocation failures. Allocate by sizeof(*ptr) rather than > the type to fix checkpack warnings. Also merge multiple lines into > one line for the k

Re: [PATCH] VSOCK: remove unnecessary ternary operator on return value

2017-03-28 Thread walter harms
Am 28.03.2017 17:54, schrieb Colin King: > From: Colin Ian King > > Rather than assign the positive errno values to ret and then > checking if it is positive and flip the sign, just set ret to > be the -ve errno value. > > Detected by CoverityScan, CID#986649 ("Logically Dead Code") > > Signe

Re: [patch net-next] net: qcom/emac: fix a sizeof() typo

2017-02-13 Thread walter harms
Am 13.02.2017 14:03, schrieb Timur Tabi: > walter harms wrote: >> We have a function where the argument is ignored and the rest is const ? >> >> emac_ethtool_get_regs_len seems the only user. So it would be fairly >> easy to >> move that into that function.

Re: [patch net-next] net: qcom/emac: fix a sizeof() typo

2017-02-13 Thread walter harms
Am 13.02.2017 12:00, schrieb Dan Carpenter: > We had intended to say "sizeof(u32)" but the "u" is missing. > Fortunately, sizeof(32) is also 4, so the original code still works. > > Fixes: c4e7beea2192 ("net: qcom/emac: add ethtool support for reading > hardware registers") > Signed-off-by: Dan

Re: [PATCH] NET: mkiss/6pack: Fix SIOCSIFENCAP ioctl

2017-02-11 Thread walter harms
Am 11.02.2017 00:01, schrieb Ralf Baechle: > When looking at Thomas' mkiss fix 7ba1b6890387 ("NET: mkiss: Fix panic") > I noticed that the mkiss SIOCSIFENCAPS ioctl was also doing a slightly > strange assignment > >dev->hard_header_len = AX25_KISS_HEADER_LEN + >

Re: [PATCH] mlx5/core: Use memdup_user() rather than duplicating its implementation

2016-08-20 Thread walter harms
Am 20.08.2016 08:01, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Sat, 20 Aug 2016 07:50:09 +0200 > > * Reuse existing functionality from memdup_user() instead of keeping > duplicate source code. > > This issue was detected by using the Coccinelle software. > > * Return direc

Re: [patch -next] wan/fsl_ucc_hdlc: info leak in uhdlc_ioctl()

2016-07-14 Thread walter harms
Am 14.07.2016 12:34, schrieb Dan Carpenter: > There is a 2 byte struct whole after line.loopback so we need to clear > that out to avoid disclosing stack information. > > Fixes: c19b6d246a35 ('drivers/net: support hdlc function for QE-UCC') > Signed-off-by: Dan Carpenter > > diff --git a/drive

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

2016-04-11 Thread walter harms
this is a case for kmemdup(). target->hwinfo=kmemdup(scan_info,be16_to_cpu(scan_info->size), GFP_KERNEL); re, wh Am 11.04.2016 12:00, schrieb Christophe JAILLET: > Hi, > > while looking at potential clean-up, I ended on the following code which > looks spurious to me. > > We allocate 'be16_

Re: [RFC PATCH 6/6] ppp: add rtnetlink device creation support

2016-04-06 Thread walter harms
Am 05.04.2016 23:22, schrieb Guillaume Nault: > On Tue, Apr 05, 2016 at 07:18:14PM +0200, walter harms wrote: >> >> >> Am 05.04.2016 02:56, schrieb Guillaume Nault: >>> @@ -1043,12 +1048,39 @@ static int ppp_dev_configure(struct net *src_ne

Re: [RFC PATCH 6/6] ppp: add rtnetlink device creation support

2016-04-05 Thread walter harms
Am 05.04.2016 02:56, schrieb Guillaume Nault: > Define PPP device handlers for use with rtnetlink. > The only PPP specific attribute is IFLA_PPP_DEV_FD. It is mandatory and > contains the file descriptor of the associated /dev/ppp instance (the > file descriptor which would have been used for ioc

Re: [PATCH net 1/3] net: validate variable length ll headers

2016-03-05 Thread walter harms
Am 04.03.2016 21:44, schrieb Willem de Bruijn: > From: Willem de Bruijn > > Netdevice parameter hard_header_len is variously interpreted both as > an upper and lower bound on link layer header length. The field is > used as upper bound when reserving room at allocation, as lower bound > when va

Re: [PATCH 2/2] ppp: implement rtnetlink device handling

2016-01-25 Thread walter harms
Am 23.12.2015 21:04, schrieb Guillaume Nault: > Define PPP device handler for use with rtnetlink. > > The only PPP specific attribute is IFLA_PPP_DEV_FD. It is mandatory and > contains the file descriptor of the associated /dev/ppp instance (the > file descriptor which would have been used for i

Re: [patch] qlcnic: fix a timeout loop

2015-12-15 Thread walter harms
Am 15.12.2015 14:46, schrieb Manish Chopra: >> -Original Message- >> From: dept_hsg_linux_nic_dev-boun...@qlclistserver.qlogic.com >> [mailto:dept_hsg_linux_nic_dev-boun...@qlclistserver.qlogic.com] On Behalf >> Of Dan Carpenter >> Sent: Tuesday, December 15, 2015 3:46 PM >> To: Dept-GE L

Re: [PATCH] decnet: remove macro-local declarations

2015-11-06 Thread walter harms
+1 I like this more since it is much more obvious what is done. more over we can remove a macro with only 2 users. re, wh Am 06.11.2015 11:57, schrieb Julia Lawall: >>> Would it be preferable to remove the macro entirely and inline the for >>> loop header? >> >> Could you show me an example o

Re: [PATCH] fib_trie: Fix potential null pointer dereference

2015-06-06 Thread walter harms
Am 06.06.2015 13:35, schrieb Firo Yang: > A smatch warning. > When kmem_cache_alloc() failed to alloc memory, a null pointer > will be returned. Redeference null pointer will generate > an unnecessary oops. So, use it after check. > > Signed-off-by: Firo Yang > --- > net/ipv4/fib_trie.c | 3 ++

Re: [KJ] [tipc-discussion] [patch] net/tipc: sprintf/strcpy conversion

2006-11-01 Thread walter harms
Florian Westphal wrote: > walter harms <[EMAIL PROTECTED]> wrote: >> These line >> + strcpy(bcbearer->media.name, "tipc-multicast"); >> i gues that means tipc_bclink_name ? > > The idea was to change how things are done, not _what_ is being do

Re: [KJ] [patch] net/tipc: sprintf/strcpy conversion

2006-11-01 Thread walter harms
David Miller wrote: > From: walter harms <[EMAIL PROTECTED]> > Date: Wed, 01 Nov 2006 22:38:26 +0100 > >> These line >> +strcpy(bcbearer->media.name, "tipc-multicast"); >> >> i gues that means tipc_bclink_name ? mea culpa, i should not w

Re: [KJ] [patch] net/tipc: sprintf/strcpy conversion

2006-11-01 Thread walter harms
hi Florian, These line + strcpy(bcbearer->media.name, "tipc-multicast"); i gues that means tipc_bclink_name ? an even more secure version could be like this: strncpy(bcbearer->media.name,sizeof(bcbearer->media.name),tipc_bclink_name); (in case someone ever changes the size of cb