Fix for a memory leak in dp_mst, a (userspace) build fix for
DMA_BUF_SET_NAME defines and a directory name generation fix for dmabuf stats -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYodCAgAKCRDj7w1vZxhR xWqzAP4nXxgBKfl2x0Iok+fefnzzQJWbobh9yw+z2h7o7hUwLwEA0L3Ji5+m7QEL zicBRRoaebuix5g9suIMjFDlS326Twk= =feeb -----END PGP SIGNATURE----- Merge tag 'drm-misc-fixes-2022-05-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Fix for a memory leak in dp_mst, a (userspace) build fix for DMA_BUF_SET_NAME defines and a directory name generation fix for dmabuf stats Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20220520072408.cpjzy2taugagvrh7@houatpull/708/merge
commit
6e4a61cd39
|
|
@ -407,6 +407,7 @@ static inline int is_dma_buf_file(struct file *file)
|
||||||
|
|
||||||
static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags)
|
static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags)
|
||||||
{
|
{
|
||||||
|
static atomic64_t dmabuf_inode = ATOMIC64_INIT(0);
|
||||||
struct file *file;
|
struct file *file;
|
||||||
struct inode *inode = alloc_anon_inode(dma_buf_mnt->mnt_sb);
|
struct inode *inode = alloc_anon_inode(dma_buf_mnt->mnt_sb);
|
||||||
|
|
||||||
|
|
@ -416,6 +417,13 @@ static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags)
|
||||||
inode->i_size = dmabuf->size;
|
inode->i_size = dmabuf->size;
|
||||||
inode_set_bytes(inode, dmabuf->size);
|
inode_set_bytes(inode, dmabuf->size);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The ->i_ino acquired from get_next_ino() is not unique thus
|
||||||
|
* not suitable for using it as dentry name by dmabuf stats.
|
||||||
|
* Override ->i_ino with the unique and dmabuffs specific
|
||||||
|
* value.
|
||||||
|
*/
|
||||||
|
inode->i_ino = atomic64_add_return(1, &dmabuf_inode);
|
||||||
file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf",
|
file = alloc_file_pseudo(inode, dma_buf_mnt, "dmabuf",
|
||||||
flags, &dma_buf_fops);
|
flags, &dma_buf_fops);
|
||||||
if (IS_ERR(file))
|
if (IS_ERR(file))
|
||||||
|
|
|
||||||
|
|
@ -4852,6 +4852,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
|
||||||
|
|
||||||
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
|
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
|
||||||
drm_edid_get_monitor_name(mst_edid, name, namelen);
|
drm_edid_get_monitor_name(mst_edid, name, namelen);
|
||||||
|
kfree(mst_edid);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ struct dma_buf_sync {
|
||||||
* between them in actual uapi, they're just different numbers.
|
* between them in actual uapi, they're just different numbers.
|
||||||
*/
|
*/
|
||||||
#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
|
#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
|
||||||
#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, u32)
|
#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32)
|
||||||
#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, u64)
|
#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue