Commit cf635a6b authored by Yi Yang's avatar Yi Yang
Browse files

crypto: fix kabi broken in struct crypto_instance

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8J49D



--------------------------------

Fix kabi breakage in commit 9ae4577b ("crypto: api - Use
work queue in crypto_destroy_instance")

Signed-off-by: default avatarYi Yang <yiyang13@huawei.com>
parent 44d86a8d
Loading
Loading
Loading
Loading
+17 −4
Original line number Original line Diff line number Diff line
@@ -71,22 +71,35 @@ static void crypto_free_instance(struct crypto_instance *inst)


static void crypto_destroy_instance_workfn(struct work_struct *w)
static void crypto_destroy_instance_workfn(struct work_struct *w)
{
{
	struct crypto_instance *inst = container_of(w, struct crypto_instance,
	struct crypto_instance_freework *work = container_of(w,
						    free_work);
			struct crypto_instance_freework, free_work);
	struct crypto_instance *inst = work->instance;
	struct crypto_template *tmpl = inst->tmpl;
	struct crypto_template *tmpl = inst->tmpl;


	crypto_free_instance(inst);
	crypto_free_instance(inst);
	crypto_tmpl_put(tmpl);
	crypto_tmpl_put(tmpl);

	kfree(work);
}
}


static void crypto_destroy_instance(struct crypto_alg *alg)
static void crypto_destroy_instance(struct crypto_alg *alg)
{
{
	struct crypto_instance_freework *work;
	struct crypto_instance *inst = container_of(alg,
	struct crypto_instance *inst = container_of(alg,
						    struct crypto_instance,
						    struct crypto_instance,
						    alg);
						    alg);
	struct crypto_template *tmpl = inst->tmpl;

	work = kzalloc(sizeof(*work), GFP_ATOMIC);
	if (!work) {
		crypto_free_instance(inst);
		crypto_tmpl_put(tmpl);
		return;
	}
	work->instance = inst;


	INIT_WORK(&inst->free_work, crypto_destroy_instance_workfn);
	INIT_WORK(&work->free_work, crypto_destroy_instance_workfn);
	schedule_work(&inst->free_work);
	schedule_work(&work->free_work);
}
}


/*
/*
+5 −2
Original line number Original line Diff line number Diff line
@@ -44,6 +44,11 @@ struct crypto_type {
	unsigned int tfmsize;
	unsigned int tfmsize;
};
};


struct crypto_instance_freework {
	struct crypto_instance *instance;
	struct work_struct free_work;
};

struct crypto_instance {
struct crypto_instance {
	struct crypto_alg alg;
	struct crypto_alg alg;


@@ -56,8 +61,6 @@ struct crypto_instance {
		struct crypto_spawn *spawns;
		struct crypto_spawn *spawns;
	};
	};


	struct work_struct free_work;

	void *__ctx[] CRYPTO_MINALIGN_ATTR;
	void *__ctx[] CRYPTO_MINALIGN_ATTR;
};
};