From bcd35b9f5f808bab473b639f2af54901b036f3ef Mon Sep 17 00:00:00 2001 From: veega2022 Date: Mon, 12 Dec 2022 14:19:30 +0800 Subject: [PATCH] socip: Return -EINVAL when the parameter check fails add patch for fix socip module problem Signed-off-by: veega2022 (cherry picked from commit 7667c8798092fe39837c876b22745ddfd83433f1) --- ...INVAL-when-the-parameter-check-fails.patch | 35 +++++++++++++++++++ hikptool.spec | 7 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch diff --git a/0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch b/0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch new file mode 100644 index 0000000..112cf62 --- /dev/null +++ b/0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch @@ -0,0 +1,35 @@ +From b70d76d5c20b3fb32e01986568c695da5879106b Mon Sep 17 00:00:00 2001 +From: veega2022 +Date: Sat, 10 Dec 2022 18:07:54 +0800 +Subject: [PATCH] socip: Return -EINVAL when the parameter check fails + +Return -EINVAL when the parameter check fails + +Signed-off-by: fangjian +--- + socip/hikp_socip_dumpreg.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/socip/hikp_socip_dumpreg.c b/socip/hikp_socip_dumpreg.c +index 088f5dd..b74dac8 100644 +--- a/socip/hikp_socip_dumpreg.c ++++ b/socip/hikp_socip_dumpreg.c +@@ -131,6 +131,7 @@ static void hikp_socip_dumpreg_execute(struct major_cmd_ctrl *self) + struct hikp_cmd_ret *cmd_ret; + + if (!check_socip_dumpreg_param()) { ++ self->err_no = -EINVAL; + cmd_socip_dump_help(self, NULL); + return; + } +@@ -141,6 +142,7 @@ static void hikp_socip_dumpreg_execute(struct major_cmd_ctrl *self) + hikp_cmd_init(&req_header, SOCIP_MOD, HIKP_SOCIP_CMD_DUMPREG, param[MODULE_ID_INDEX].val); + cmd_ret = hikp_cmd_alloc(&req_header, &req_data, sizeof(req_data)); + if (!cmd_ret) { ++ self->err_no=-EINVAL; + HIKP_ERROR_PRINT("hikp_cmd_alloc\n"); + return; + } +-- +2.33.0 + diff --git a/hikptool.spec b/hikptool.spec index 95cc82f..22658c2 100644 --- a/hikptool.spec +++ b/hikptool.spec @@ -3,7 +3,7 @@ Name: hikptool Summary: A userspace tool for Linux providing problem location on Kunpeng chips Version: 1.0.0 -Release: 5 +Release: 6 License: MulanPSL2 Source: %{name}-%{version}.tar.gz ExclusiveOS: linux @@ -16,6 +16,8 @@ BuildRequires: gcc make cmake Requires: glibc ExclusiveArch: aarch64 +Patch0001: 0001-socip-Return-EINVAL-when-the-parameter-check-fails.patch + %description This package contains the hikptool @@ -67,6 +69,9 @@ fi /sbin/ldconfig %changelog +* Mon Dec 12 2022 veega2022 1.0.0-6 +- Add socip patch for fix return -EINVAL when the parameter check fails + * Thu Nov 24 2022 veega2022 1.0.0-5 - Add nic_ppp dump mac and vlan function and change the hikptool permission to 0500 -- Gitee