Skip to content

Commit 06e981a

Browse files
committed
Merge tag 'qcomtee-fixes-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee into soc/drivers
QCOMTEE fixes for 6.20 Small cleanups for the qcomtee driver to align with recommended coding practices for the cleanup.h infrastructure. * tag 'qcomtee-fixes-for-6.20' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee: tee: qcomtee: user: Fix confusing cleanup.h syntax tee: qcomtee: mem: Fix confusing cleanup.h syntax tee: qcomtee: call: Fix confusing cleanup.h syntax Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents f716774 + 1c05d9a commit 06e981a

3 files changed

Lines changed: 14 additions & 15 deletions

File tree

drivers/tee/qcomtee/call.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,7 @@ static int qcomtee_object_invoke(struct tee_context *ctx,
395395
struct tee_ioctl_object_invoke_arg *arg,
396396
struct tee_param *params)
397397
{
398-
struct qcomtee_object_invoke_ctx *oic __free(kfree) = NULL;
399398
struct qcomtee_context_data *ctxdata = ctx->data;
400-
struct qcomtee_arg *u __free(kfree) = NULL;
401399
struct qcomtee_object *object;
402400
int i, ret, result;
403401

@@ -412,12 +410,14 @@ static int qcomtee_object_invoke(struct tee_context *ctx,
412410
}
413411

414412
/* Otherwise, invoke a QTEE object: */
415-
oic = qcomtee_object_invoke_ctx_alloc(ctx);
413+
struct qcomtee_object_invoke_ctx *oic __free(kfree) =
414+
qcomtee_object_invoke_ctx_alloc(ctx);
416415
if (!oic)
417416
return -ENOMEM;
418417

419418
/* +1 for ending QCOMTEE_ARG_TYPE_INV. */
420-
u = kcalloc(arg->num_params + 1, sizeof(*u), GFP_KERNEL);
419+
struct qcomtee_arg *u __free(kfree) = kcalloc(arg->num_params + 1, sizeof(*u),
420+
GFP_KERNEL);
421421
if (!u)
422422
return -ENOMEM;
423423

@@ -562,9 +562,8 @@ static int qcomtee_supp_send(struct tee_context *ctx, u32 errno, u32 num_params,
562562

563563
static int qcomtee_open(struct tee_context *ctx)
564564
{
565-
struct qcomtee_context_data *ctxdata __free(kfree) = NULL;
566-
567-
ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL);
565+
struct qcomtee_context_data *ctxdata __free(kfree) = kzalloc(sizeof(*ctxdata),
566+
GFP_KERNEL);
568567
if (!ctxdata)
569568
return -ENOMEM;
570569

@@ -645,12 +644,12 @@ static void qcomtee_get_version(struct tee_device *teedev,
645644
static void qcomtee_get_qtee_feature_list(struct tee_context *ctx, u32 id,
646645
u32 *version)
647646
{
648-
struct qcomtee_object_invoke_ctx *oic __free(kfree) = NULL;
649647
struct qcomtee_object *client_env, *service;
650648
struct qcomtee_arg u[3] = { 0 };
651649
int result;
652650

653-
oic = qcomtee_object_invoke_ctx_alloc(ctx);
651+
struct qcomtee_object_invoke_ctx *oic __free(kfree) =
652+
qcomtee_object_invoke_ctx_alloc(ctx);
654653
if (!oic)
655654
return;
656655

drivers/tee/qcomtee/mem_obj.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ int qcomtee_memobj_param_to_object(struct qcomtee_object **object,
8888
struct tee_param *param,
8989
struct tee_context *ctx)
9090
{
91-
struct qcomtee_mem_object *mem_object __free(kfree) = NULL;
9291
struct tee_shm *shm;
9392
int err;
9493

95-
mem_object = kzalloc(sizeof(*mem_object), GFP_KERNEL);
94+
struct qcomtee_mem_object *mem_object __free(kfree) = kzalloc(sizeof(*mem_object),
95+
GFP_KERNEL);
9696
if (!mem_object)
9797
return -ENOMEM;
9898

drivers/tee/qcomtee/user_obj.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,10 @@ static int qcomtee_user_object_dispatch(struct qcomtee_object_invoke_ctx *oic,
228228
{
229229
struct qcomtee_user_object *uo = to_qcomtee_user_object(object);
230230
struct qcomtee_context_data *ctxdata = uo->ctx->data;
231-
struct qcomtee_ureq *ureq __free(kfree) = NULL;
232231
int errno;
233232

234-
ureq = kzalloc(sizeof(*ureq), GFP_KERNEL);
233+
struct qcomtee_ureq *ureq __free(kfree) = kzalloc(sizeof(*ureq),
234+
GFP_KERNEL);
235235
if (!ureq)
236236
return -ENOMEM;
237237

@@ -367,10 +367,10 @@ int qcomtee_user_param_to_object(struct qcomtee_object **object,
367367
struct tee_param *param,
368368
struct tee_context *ctx)
369369
{
370-
struct qcomtee_user_object *user_object __free(kfree) = NULL;
371370
int err;
372371

373-
user_object = kzalloc(sizeof(*user_object), GFP_KERNEL);
372+
struct qcomtee_user_object *user_object __free(kfree) =
373+
kzalloc(sizeof(*user_object), GFP_KERNEL);
374374
if (!user_object)
375375
return -ENOMEM;
376376

0 commit comments

Comments
 (0)