ila_common.h: Remove redundant check for neutral-map-auto in ila_csum_name2mode function
Subsystems (3)
PATCH 1/1 ila_common.h: Remove redundant check for neutral-map-auto in ila_csum_name2mode function
The neutral-map-auto option was already handled correctly in the switch statement of the ila_csum_name2mode function. Removing the redundant check for neutral-map-auto simplifies the code without changing its behavior.
Signed-off-by Anton <[email protected]>
--- ip/ila_common.h | 2 -- 1 file changed, 2 deletions(-)
ip/ila_common.h +0 -2
@@ -27,8 +27,6 @@ static inline int ila_csum_name2mode(char *name)return ILA_CSUM_ADJUST_TRANSPORT ; else if (strcmp(name, "neutral-map") == 0) return ILA_CSUM_NEUTRAL_MAP; - else if (strcmp(name, "neutral-map-auto") == 0) - return ILA_CSUM_NEUTRAL_MAP_AUTO; else if (strcmp(name, "no-action") == 0) return ILA_CSUM_NO_ACTION; else if (strcmp(name, "neutral-map-auto") == 0)
Signature · 1 line
2.43.0
PATCH 1/1 utils.c: Fixed potential memory leak in getcmdline function
The getcmdline function in utils.c dynamically allocates memory for the line1 variable using getline function but fails to free it in case of an error. Added a check to free the allocated memory if getline returns a negative value, preventing potential memory leaks.
Signed-off-by Anton [email protected]
--- lib/utils.c | 3 +++ 1 file changed, 3 insertions(+)
lib/utils.c +3 -0
@@ -1339,6 +1339,9 @@ static ssize_t getcmdline(char **linep, size_t *lenp, FILE *in) cc1 =getline (&line1, &len1, in);if (cc1 <0 ) {fprintf (stderr,"Missing continuation line\n" ); +if (line1) { +free (line1); + }return cc1; }
Signature · 1 line
2.43.0