link: Catch missing io_free() implementations

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Graf 2014-03-31 13:21:06 +02:00 committed by Thomas Haller
parent baa2cadd02
commit 34bfce6215
2 changed files with 11 additions and 0 deletions

View file

@ -102,6 +102,13 @@ struct trans_list {
assert(0); \
} while (0)
#define BUG_ON(condition) \
do { \
if (condition) \
BUG(); \
} while (0)
#define APPBUG(msg) \
do { \
fprintf(stderr, "APPLICATION BUG: %s:%d:%s: %s\n", \

View file

@ -194,6 +194,10 @@ static void release_link_info(struct rtnl_link *link)
if (io != NULL) {
if (io->io_free)
io->io_free(link);
else {
/* Catch missing io_free() implementations */
BUG_ON(link->l_info);
}
rtnl_link_info_ops_put(io);
link->l_info_ops = NULL;
}