File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -140,9 +140,8 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
140140 spawn = skcipher_instance_ctx (inst );
141141 err = crypto_init_spawn (spawn , alg , skcipher_crypto_instance (inst ),
142142 CRYPTO_ALG_TYPE_MASK );
143- crypto_mod_put (alg );
144143 if (err )
145- goto err_free_inst ;
144+ goto err_put_alg ;
146145
147146 err = crypto_inst_setname (skcipher_crypto_instance (inst ), "cbc" , alg );
148147 if (err )
@@ -174,12 +173,15 @@ static int crypto_cbc_create(struct crypto_template *tmpl, struct rtattr **tb)
174173 err = skcipher_register_instance (tmpl , inst );
175174 if (err )
176175 goto err_drop_spawn ;
176+ crypto_mod_put (alg );
177177
178178out :
179179 return err ;
180180
181181err_drop_spawn :
182182 crypto_drop_spawn (spawn );
183+ err_put_alg :
184+ crypto_mod_put (alg );
183185err_free_inst :
184186 kfree (inst );
185187 goto out ;
Original file line number Diff line number Diff line change @@ -286,9 +286,8 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
286286 spawn = skcipher_instance_ctx (inst );
287287 err = crypto_init_spawn (spawn , alg , skcipher_crypto_instance (inst ),
288288 CRYPTO_ALG_TYPE_MASK );
289- crypto_mod_put (alg );
290289 if (err )
291- goto err_free_inst ;
290+ goto err_put_alg ;
292291
293292 err = crypto_inst_setname (skcipher_crypto_instance (inst ), "cfb" , alg );
294293 if (err )
@@ -317,12 +316,15 @@ static int crypto_cfb_create(struct crypto_template *tmpl, struct rtattr **tb)
317316 err = skcipher_register_instance (tmpl , inst );
318317 if (err )
319318 goto err_drop_spawn ;
319+ crypto_mod_put (alg );
320320
321321out :
322322 return err ;
323323
324324err_drop_spawn :
325325 crypto_drop_spawn (spawn );
326+ err_put_alg :
327+ crypto_mod_put (alg );
326328err_free_inst :
327329 kfree (inst );
328330 goto out ;
Original file line number Diff line number Diff line change @@ -244,9 +244,8 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
244244 spawn = skcipher_instance_ctx (inst );
245245 err = crypto_init_spawn (spawn , alg , skcipher_crypto_instance (inst ),
246246 CRYPTO_ALG_TYPE_MASK );
247- crypto_mod_put (alg );
248247 if (err )
249- goto err_free_inst ;
248+ goto err_put_alg ;
250249
251250 err = crypto_inst_setname (skcipher_crypto_instance (inst ), "pcbc" , alg );
252251 if (err )
@@ -275,12 +274,15 @@ static int crypto_pcbc_create(struct crypto_template *tmpl, struct rtattr **tb)
275274 err = skcipher_register_instance (tmpl , inst );
276275 if (err )
277276 goto err_drop_spawn ;
277+ crypto_mod_put (alg );
278278
279279out :
280280 return err ;
281281
282282err_drop_spawn :
283283 crypto_drop_spawn (spawn );
284+ err_put_alg :
285+ crypto_mod_put (alg );
284286err_free_inst :
285287 kfree (inst );
286288 goto out ;
You can’t perform that action at this time.
0 commit comments