diff options
| author | Dave Airlie <airlied@redhat.com> | 2024-11-04 14:25:33 +1000 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2024-11-04 14:25:33 +1000 |
| commit | 30169bb64580bd7bce9290c1952bf0aa6cc37fe5 (patch) | |
| tree | 94c6ab9dec68f5648a055752aad32d816bd27e11 /net/socket.c | |
| parent | bcfe43f0ea77c42c2154fb79b99b7d1d82ac3231 (diff) | |
| parent | 59b723cd2adbac2a34fc8e12c74ae26ae45bf230 (diff) | |
Backmerge v6.12-rc6 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next
Backmerge Linus tree for some drm-fixes needed for msm and xe merges.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'net/socket.c')
| -rw-r--r-- | net/socket.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/socket.c b/net/socket.c index 601ad74930ef..042451f01c65 100644 --- a/net/socket.c +++ b/net/socket.c @@ -1574,8 +1574,13 @@ int __sock_create(struct net *net, int family, int type, int protocol, rcu_read_unlock(); err = pf->create(net, sock, protocol, kern); - if (err < 0) + if (err < 0) { + /* ->create should release the allocated sock->sk object on error + * but it may leave the dangling pointer + */ + sock->sk = NULL; goto out_module_put; + } /* * Now to bump the refcnt of the [loadable] module that owns this |
