Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: refactor call to request_module

This reduces the size of the stack frame when calling request_module().
Performing the sprintf before the call is not needed.

Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Kees Cook and committed by
Dave Airlie
d1fd3ddc ebbd97ad

+1 -5
+1 -5
drivers/gpu/drm/drm_encoder_slave.c
··· 54 54 struct i2c_adapter *adap, 55 55 const struct i2c_board_info *info) 56 56 { 57 - char modalias[sizeof(I2C_MODULE_PREFIX) 58 - + I2C_NAME_SIZE]; 59 57 struct module *module = NULL; 60 58 struct i2c_client *client; 61 59 struct drm_i2c_encoder_driver *encoder_drv; 62 60 int err = 0; 63 61 64 - snprintf(modalias, sizeof(modalias), 65 - "%s%s", I2C_MODULE_PREFIX, info->type); 66 - request_module(modalias); 62 + request_module("%s%s", I2C_MODULE_PREFIX, info->type); 67 63 68 64 client = i2c_new_device(adap, info); 69 65 if (!client) {