lindebugfs: Make single_release() NULL safe.
MFC after: 1 week Sponsored by: NVIDIA Networking
This commit is contained in:
parent
68ec2949ad
commit
a23e475c48
@ -147,9 +147,15 @@ seq_release(struct inode *inode __unused, struct linux_file *file)
|
||||
int
|
||||
single_release(struct vnode *v, struct linux_file *f)
|
||||
{
|
||||
const struct seq_operations *op = ((struct seq_file *)f->private_data)->op;
|
||||
const struct seq_operations *op;
|
||||
struct seq_file *m;
|
||||
int rc;
|
||||
|
||||
/* be NULL safe */
|
||||
if ((m = f->private_data) == NULL)
|
||||
return (0);
|
||||
|
||||
op = m->op;
|
||||
rc = seq_release(v, f);
|
||||
free(__DECONST(void *, op), M_LSEQ);
|
||||
return (rc);
|
||||
|
Loading…
Reference in New Issue
Block a user