summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev/savage/savagefb_driver.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-12-08 10:27:36 +0300
committerHelge Deller <deller@gmx.de>2022-01-30 21:37:03 +0300
commit0f8a1cae923670b1cabb9a8f416271344159bd50 (patch)
treedb17f17b811d9a35092f7252124e3e3eee5039e7 /drivers/video/fbdev/savage/savagefb_driver.c
parent24565bc4115961db7ee64fcc7ad2a7437c0d0a49 (diff)
downloadlinux-0f8a1cae923670b1cabb9a8f416271344159bd50.tar.xz
video: fbdev: savagefb: make a variable local
The "edid" struct member is only used during probe() and it's freed right away. There is no point in storing a freed pointer for the whole life of the driver. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers/video/fbdev/savage/savagefb_driver.c')
-rw-r--r--drivers/video/fbdev/savage/savagefb_driver.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/video/fbdev/savage/savagefb_driver.c b/drivers/video/fbdev/savage/savagefb_driver.c
index 0ac750cc5ea1..8114c921ceb8 100644
--- a/drivers/video/fbdev/savage/savagefb_driver.c
+++ b/drivers/video/fbdev/savage/savagefb_driver.c
@@ -2170,6 +2170,7 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
struct fb_info *info;
struct savagefb_par *par;
u_int h_sync, v_sync;
+ unsigned char __maybe_unused *edid;
int err, lpitch;
int video_len;
@@ -2212,9 +2213,9 @@ static int savagefb_probe(struct pci_dev *dev, const struct pci_device_id *id)
INIT_LIST_HEAD(&info->modelist);
#if defined(CONFIG_FB_SAVAGE_I2C)
savagefb_create_i2c_busses(info);
- savagefb_probe_i2c_connector(info, &par->edid);
- fb_edid_to_monspecs(par->edid, &info->monspecs);
- kfree(par->edid);
+ savagefb_probe_i2c_connector(info, &edid);
+ fb_edid_to_monspecs(edid, &info->monspecs);
+ kfree(edid);
fb_videomode_to_modelist(info->monspecs.modedb,
info->monspecs.modedb_len,
&info->modelist);