It looks like there's a lot of incorrect code like this:
tmp = object_update_param_get(update, 1, &size);
if (IS_ERR(tmp) || size != sizeof(*tmp)) {
CERROR("%s: empty or wrong size %zu pos: rc = %ld\n",
tgt_name(tsi->tsi_tgt), size, PTR_ERR(tmp));
RETURN(PTR_ERR(tmp));
}
so it's clear when IS_ERR is true all is fine, but when sizeof does not match - the pointer is likely valid so some different handling needs to be made?
here's the total list of all offenders:
lustre/target/out_handler.c:120 out_create() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:122 out_create() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:134 out_create() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:136 out_create() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:173 out_attr_set() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:175 out_attr_set() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:442 out_xattr_set() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:444 out_xattr_set() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:539 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:541 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:555 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:557 out_index_insert() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:642 out_write() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:644 out_write() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:651 out_write() warn: passing a valid pointer to 'PTR_ERR'
lustre/target/out_handler.c:653 out_write() warn: passing a valid pointer to 'PTR_ERR'