Re: [PATCH] block: missing module_put in put_disk

From: Al Viro
Date: Fri Oct 29 2010 - 12:10:08 EST


On Fri, Oct 29, 2010 at 11:51:35AM -0400, Chun Wu wrote:
> From: Chun Wu <chun.wu84@xxxxxxxxx>
>
> module_put function is not called in put_disk function. Should it be added?

Check the callers. Check the callers of get_disk. Think whether those
two are counterparts. See if any callers would have module_put() nearby.
See if any callers would not have module_put() nearby. See if there is
anything that would distinguish one class from another. Think whether
they need different behaviour. Then you'll be able to answer your
question. As a bonus, consider the source of confusion and see if you
can remove it [I'm serious, BTW - get_disk() is apparently a lousy name
asking for confusion; renaming it might be a useful thing to do, provided
that new name would be less confusing]

[snip the patch blindly adding such call]
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/