mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-18 17:21:56 +00:00
nss-drv: nss_rps: fix buff size when writing
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
1f7a6b7879
commit
febe0256ca
@ -156,7 +156,7 @@
|
|||||||
*lenp = cp_bytes;
|
*lenp = cp_bytes;
|
||||||
kfree(r_buf);
|
kfree(r_buf);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -115,13 +115,11 @@ static int nss_dscp_map_print(struct ctl
|
@@ -115,35 +115,32 @@ static int nss_dscp_map_print(struct ctl
|
||||||
* nss_dscp_map_parse()
|
* nss_dscp_map_parse()
|
||||||
* Sysctl handler for dscp/pri mappings.
|
* Sysctl handler for dscp/pri mappings.
|
||||||
*/
|
*/
|
||||||
@ -166,12 +166,22 @@
|
|||||||
{
|
{
|
||||||
int count;
|
int count;
|
||||||
- size_t cp_bytes = 0;
|
- size_t cp_bytes = 0;
|
||||||
char w_buf[7];
|
- char w_buf[7];
|
||||||
- loff_t w_offset = 0;
|
- loff_t w_offset = 0;
|
||||||
|
+ char w_buf[8];
|
||||||
char *str;
|
char *str;
|
||||||
char *tokens[NSS_DSCP_MAP_PARAM_FIELD_COUNT];
|
char *tokens[NSS_DSCP_MAP_PARAM_FIELD_COUNT];
|
||||||
unsigned int dscp, priority, action;
|
unsigned int dscp, priority, action;
|
||||||
@@ -135,15 +133,14 @@ static int nss_dscp_map_parse(struct ctl
|
int ret;
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * Buffer length cannot be more than 7 and less than 6.
|
||||||
|
+ * Buffer length cannot be more than 8 and less than 6.
|
||||||
|
*/
|
||||||
|
- if (*lenp < 6 || *lenp > 7) {
|
||||||
|
- nss_warning("Buffer is not correct. Invalid lenght: %d\n", (int)*lenp);
|
||||||
|
+ if (*lenp < 6 || *lenp > 8) {
|
||||||
|
+ nss_warning("Invalid length: %d\n", (int)*lenp);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user