Commit 0f8a1cae authored by Dan Carpenter's avatar Dan Carpenter Committed by Helge Deller
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 24565bc4
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -195,7 +195,6 @@ struct savagefb_par {
	struct savage_reg initial;
	struct vgastate vgastate;
	struct mutex open_lock;
	unsigned char   *edid;
	u32 pseudo_palette[16];
	u32 open_count;
	int paletteEnabled;
+4 −3
Original line number Diff line number Diff line
@@ -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);