Skip to contentSkip to conversation

rdma: Fix for ineffective check in add_filter()

PATCH Applied Phil Sutter 3 participants 4 messages Oct 18, 2018 – Oct 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rdma: Fix for ineffective check in add_filter()

With 'name' field defined as array in struct filters, it will always contain a value irrespective of whether a name was assigned or not.

Fix this by turning the field into a const char pointer.

Fixes 8cd644095842a ("devlink: Add support for devlink resource abstraction")
---
 rdma/rdma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rdma/rdma.h +1 -1
index d4b7ba1918b13..c3b7530b6cc71 100644
@@ -34,7 +34,7 @@
 
 #define MAX_NUMBER_OF_FILTERS 64
 struct filters {
-	char name[32];
+	const char *name;
 	bool is_number;
 };
 
Signature · 1 line
2.19.0
#1 lore raw
Quoted 6 lines · Phil Sutter

With 'name' field defined as array in struct filters, it will always contain a value irrespective of whether a name was assigned or not.

Fix this by turning the field into a const char pointer.

Fixes 8cd644095842a ("devlink: Add support for devlink resource abstraction")

Stale paste buffer? Seems like the correct tag is

Fixes 1174be72d1b4c ("rdma: Add filtering infrastructure")
Quoted 19 lines
---
 rdma/rdma.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
rdma/rdma.h +1 -1
index d4b7ba1918b13..c3b7530b6cc71 100644
@@ -34,7 +34,7 @@
 
 #define MAX_NUMBER_OF_FILTERS 64
 struct filters {
-	char name[32];
+	const char *name;
 	bool is_number;
 };
 
#2 lore raw

Hi,

Quoted 10 lines · David Ahern
Quoted 6 lines · Phil Sutter

With 'name' field defined as array in struct filters, it will always contain a value irrespective of whether a name was assigned or not.

Fix this by turning the field into a const char pointer.

Fixes 8cd644095842a ("devlink: Add support for devlink resource abstraction")

Stale paste buffer? Seems like the correct tag is

Fixes 1174be72d1b4c ("rdma: Add filtering infrastructure")

Oh, indeed. Also the wrong person in Cc: Arkadi is innocent, culprit patch came from Leon.

Stephen, should I respin or will you correct the Fixes tag?

Thanks, Phil

#3 lore raw
In reply to Phil Sutter
Quoted 7 lines · On Thu, 18 Oct 2018 13:41:54 +0200 Phil Sutter <[email protected]> wrote:

With 'name' field defined as array in struct filters, it will always contain a value irrespective of whether a name was assigned or not.

Fix this by turning the field into a const char pointer.

Fixes 8cd644095842a ("devlink: Add support for devlink resource abstraction")

Applied, and fixed fixes