linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] staging: r8188eu: core: Change the length of an array
@ 2021-08-02 20:30 Fabio M. De Francesco
  2021-08-03  6:14 ` Dan Carpenter
  0 siblings, 1 reply; 6+ messages in thread
From: Fabio M. De Francesco @ 2021-08-02 20:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Larry Finger, linux-staging, linux-kernel,
	Dan Carpenter
  Cc: Fabio M. De Francesco

IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
before the fields of the union.

Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

Changes in v2:
	Add a "Fixes:" tag.

 drivers/staging/r8188eu/core/rtw_br_ext.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 8f434768dd15..c585224080c6 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -137,9 +137,9 @@ static inline void __nat25_generate_ipx_network_addr_with_node(unsigned char *ne
 				__be32 *ipxNetAddr, unsigned char *ipxNodeAddr)
 {
 	union {
-                unsigned int f0;
-                unsigned char f1[IPX_NODE_LEN];
-        } addr;
+		unsigned int f0;
+		unsigned char f1[4];
+	} addr;
 
 	memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] staging: r8188eu: core: Change the length of an array
  2021-08-02 20:30 [PATCH v2] staging: r8188eu: core: Change the length of an array Fabio M. De Francesco
@ 2021-08-03  6:14 ` Dan Carpenter
  2021-08-03  6:20   ` Greg Kroah-Hartman
  2021-08-03 13:26   ` Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-08-03  6:14 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Greg Kroah-Hartman, Larry Finger, linux-staging, linux-kernel

On Mon, Aug 02, 2021 at 10:30:20PM +0200, Fabio M. De Francesco wrote:
> IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
> Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
> before the fields of the union.
> 
> Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")

Ugh...  I really feel we'd be better off reverting that patch entirely.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] staging: r8188eu: core: Change the length of an array
  2021-08-03  6:14 ` Dan Carpenter
@ 2021-08-03  6:20   ` Greg Kroah-Hartman
  2021-08-03 13:28     ` Dan Carpenter
  2021-08-05 10:44     ` Greg Kroah-Hartman
  2021-08-03 13:26   ` Dan Carpenter
  1 sibling, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-03  6:20 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Fabio M. De Francesco, Larry Finger, linux-staging, linux-kernel

On Tue, Aug 03, 2021 at 09:14:42AM +0300, Dan Carpenter wrote:
> On Mon, Aug 02, 2021 at 10:30:20PM +0200, Fabio M. De Francesco wrote:
> > IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
> > Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
> > before the fields of the union.
> > 
> > Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")
> 
> Ugh...  I really feel we'd be better off reverting that patch entirely.

I do too, let me go revert that...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] staging: r8188eu: core: Change the length of an array
  2021-08-03  6:14 ` Dan Carpenter
  2021-08-03  6:20   ` Greg Kroah-Hartman
@ 2021-08-03 13:26   ` Dan Carpenter
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-08-03 13:26 UTC (permalink / raw)
  To: Fabio M. De Francesco
  Cc: Greg Kroah-Hartman, Larry Finger, linux-staging, linux-kernel

On Tue, Aug 03, 2021 at 09:14:42AM +0300, Dan Carpenter wrote:
> On Mon, Aug 02, 2021 at 10:30:20PM +0200, Fabio M. De Francesco wrote:
> > IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
> > Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
> > before the fields of the union.
> > 
> > Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")
> 
> Ugh...  I really feel we'd be better off reverting that patch entirely.

Get rid of all the unions and the XORing at least.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] staging: r8188eu: core: Change the length of an array
  2021-08-03  6:20   ` Greg Kroah-Hartman
@ 2021-08-03 13:28     ` Dan Carpenter
  2021-08-05 10:44     ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: Dan Carpenter @ 2021-08-03 13:28 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Fabio M. De Francesco, Larry Finger, linux-staging, linux-kernel

On Tue, Aug 03, 2021 at 08:20:39AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Aug 03, 2021 at 09:14:42AM +0300, Dan Carpenter wrote:
> > On Mon, Aug 02, 2021 at 10:30:20PM +0200, Fabio M. De Francesco wrote:
> > > IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
> > > Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
> > > before the fields of the union.
> > > 
> > > Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")
> > 
> > Ugh...  I really feel we'd be better off reverting that patch entirely.
> 
> I do too, let me go revert that...

Thanks!

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2] staging: r8188eu: core: Change the length of an array
  2021-08-03  6:20   ` Greg Kroah-Hartman
  2021-08-03 13:28     ` Dan Carpenter
@ 2021-08-05 10:44     ` Greg Kroah-Hartman
  1 sibling, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-05 10:44 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Fabio M. De Francesco, Larry Finger, linux-staging, linux-kernel

On Tue, Aug 03, 2021 at 08:20:39AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Aug 03, 2021 at 09:14:42AM +0300, Dan Carpenter wrote:
> > On Mon, Aug 02, 2021 at 10:30:20PM +0200, Fabio M. De Francesco wrote:
> > > IPX_NODE_LEN == 6, while addr.f1 should only have 4 elements.
> > > Replace IPX_NODE_LEN with 4. In the while, remove the excess spaces
> > > before the fields of the union.
> > > 
> > > Fixes: 56febcc2595e ("staging: r8188eu: Fix different base types in assignments and parameters")
> > 
> > Ugh...  I really feel we'd be better off reverting that patch entirely.
> 
> I do too, let me go revert that...
> 

Now reverted.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-05 10:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-02 20:30 [PATCH v2] staging: r8188eu: core: Change the length of an array Fabio M. De Francesco
2021-08-03  6:14 ` Dan Carpenter
2021-08-03  6:20   ` Greg Kroah-Hartman
2021-08-03 13:28     ` Dan Carpenter
2021-08-05 10:44     ` Greg Kroah-Hartman
2021-08-03 13:26   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).