提交 841f1b8f 编写于 作者: M Mattias Jacobsson 提交者: Darren Hart (VMware)

modpost: file2alias: define size of alias

The size of the variable alias provided to do_entry functions are
currently not readily available. Thus hindering do_entry functions to
perform bounds checking.

Define the macro ALIAS_SIZE containing the size of the variable alias.
Signed-off-by: NMattias Jacobsson <2pi@mok.nu>
Acked-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 b98dc493
......@@ -50,6 +50,9 @@ struct devtable {
int (*do_entry)(const char *filename, void *symval, char *alias);
};
/* Size of alias provided to do_entry functions */
#define ALIAS_SIZE 500
/* Define a variable f that holds the value of field f of struct devid
* based at address m.
*/
......@@ -1303,7 +1306,7 @@ static void do_table(void *symval, unsigned long size,
struct module *mod)
{
unsigned int i;
char alias[500];
char alias[ALIAS_SIZE];
device_id_check(mod->name, device_id, size, id_size, symval);
/* Leave last one: it's the terminator. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册