Content-Type: multipart/mixed; boundary="===============2029418018029913025==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 1/5] accel-config: static analysis bug fix Date: Fri, 04 Dec 2020 15:50:28 -0500 Message-ID: <20201204205031.310835-2-ramesh.thomas@intel.com> In-Reply-To: 20201204205031.310835-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============2029418018029913025== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas group is checked for null but code continues if null. This triggers 2 issues - group and dev can be dereferenced even if null. Removing the check because the function is called only if group is not null. Signed-off-by: Ramesh Thomas --- accfg/list.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/accfg/list.c b/accfg/list.c index c22da41..2234e65 100644 --- a/accfg/list.c +++ b/accfg/list.c @@ -56,8 +56,7 @@ static struct json_object *group_to_json(struct accfg_gro= up *group, struct json_object *jobj =3D NULL; struct accfg_device *dev =3D NULL; = - if (group) - dev =3D accfg_group_get_device(group); + dev =3D accfg_group_get_device(group); = if (!jgroup) return NULL; -- = 2.26.2 --===============2029418018029913025==--