Date: Fri, 16 Jul 2021 11:53:56 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 52ed44d9c09a - stable/13 - pf: pf_killstates() never fails, so remove the return value Message-ID: <202107161153.16GBru8v016047@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=52ed44d9c09a4606c108c2caa79ce7bbeed060fc commit 52ed44d9c09a4606c108c2caa79ce7bbeed060fc Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-07-08 08:54:16 +0000 Commit: Kristof Provost <kp@FreeBSD.org> CommitDate: 2021-07-16 09:08:27 +0000 pf: pf_killstates() never fails, so remove the return value Suggested by: mjg MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 34641052826c718566b994b75cd2bddb53a21583) --- sys/netpfil/pf/pf_ioctl.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 68ccb741710a..bed3e8b057d1 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -202,7 +202,7 @@ struct cdev *pf_dev; */ static void pf_clear_all_states(void); static unsigned int pf_clear_states(const struct pf_kstate_kill *); -static int pf_killstates(struct pf_kstate_kill *, +static void pf_killstates(struct pf_kstate_kill *, unsigned int *); static int pf_killstates_row(struct pf_kstate_kill *, struct pf_idhash *); @@ -2780,7 +2780,7 @@ DIOCCHANGERULE_error: break; psk->psk_killed = 0; - error = pf_killstates(&kill, &psk->psk_killed); + pf_killstates(&kill, &psk->psk_killed); break; } @@ -4835,7 +4835,7 @@ relock_DIOCCLRSTATES: return (killed); } -static int +static void pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) { struct pf_kstate *s; @@ -4848,13 +4848,13 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) pf_unlink_state(s, PF_ENTER_LOCKED); *killed = 1; } - return (0); + return; } for (unsigned int i = 0; i <= pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); - return (0); + return; } static int @@ -4887,9 +4887,7 @@ pf_killstates_nv(struct pfioc_nv *nv) if (error) ERROUT(error); - error = pf_killstates(&kill, &killed); - if (error) - ERROUT(error); + pf_killstates(&kill, &killed); free(nvlpacked, M_NVLIST); nvlpacked = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107161153.16GBru8v016047>