Content-Type: multipart/mixed; boundary="===============4215135972846635443==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [security:landlock_lsm 8/12] security/landlock/syscall.c:216:13: warning: Uninitialized variable: ruleset Date: Tue, 10 Nov 2020 18:12:57 +0800 Message-ID: <202011101854.zGbWwusK-lkp@intel.com> List-Id: --===============4215135972846635443== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-secur= ity.git landlock_lsm head: 96b3198c4025c11347651700b77e45a686d78553 commit: 0c901260bd29a3d6019531d3a3fdff7859aa88e1 [8/12] landlock: Add sysca= ll implementations compiler: powerpc64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot "cppcheck warnings: (new ones prefixed by >>)" >> security/landlock/syscall.c:216:13: warning: Uninitialized variable: rul= eset [uninitvar] return err ? ERR_PTR(err) : ruleset; ^ vim +216 security/landlock/syscall.c 189 = 190 /* 191 * Returns an owned ruleset from a FD. It is thus needed to call 192 * landlock_put_ruleset() on the return value. 193 */ 194 static struct landlock_ruleset *get_ruleset_from_fd(const int fd, 195 const fmode_t mode) 196 { 197 struct fd ruleset_f; 198 struct landlock_ruleset *ruleset; 199 int err; 200 = 201 ruleset_f =3D fdget(fd); 202 if (!ruleset_f.file) 203 return ERR_PTR(-EBADF); 204 = 205 /* Checks FD type and access right. */ 206 err =3D 0; 207 if (ruleset_f.file->f_op !=3D &ruleset_fops) 208 err =3D -EBADFD; 209 else if (!(ruleset_f.file->f_mode & mode)) 210 err =3D -EPERM; 211 if (!err) { 212 ruleset =3D ruleset_f.file->private_data; 213 landlock_get_ruleset(ruleset); 214 } 215 fdput(ruleset_f); > 216 return err ? ERR_PTR(err) : ruleset; 217 } 218 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============4215135972846635443==--