Am Donnerstag, 2. April 2015, 22:59:11 schrieb Herbert Xu: Hi Herbert, >On Thu, Apr 02, 2015 at 04:54:03PM +0200, Stephan Mueller wrote: >> >@@ -316,7 +316,7 @@ static int crypto_del_alg(struct sk_buff *skb, struct >> >nlmsghdr *nlh, if (atomic_read(&alg->cra_refcnt) != 1) >> > >> > return -EBUSY; >> > >> >- return crypto_unregister_instance(alg); >> >+ return crypto_unregister_instance((struct crypto_instance *)alg); >> >> Instead of using type casts, isn't container_of() a cleaner way (and >> hopefully a safer way) of casting? > >Actually no that would only make sense if every alg sat within >an instance which is not the case. So I don't think using that >would buy us much clarity. In crypto_remove_instance, the code dereferences inst->tmpl. If you say that it is not guaranteed that the alg is always wrapped by an inst, wouldn't we have a potential invalid pointer? > >Thanks, Ciao Stephan -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html