artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a3e5697
)
make sure the end result is NULL if malloc failed
author
jsg
<jsg@openbsd.org>
Tue, 15 Aug 2023 03:51:29 +0000
(
03:51
+0000)
committer
jsg
<jsg@openbsd.org>
Tue, 15 Aug 2023 03:51:29 +0000
(
03:51
+0000)
sys/dev/pci/drm/dma-resv.c
patch
|
blob
|
history
diff --git
a/sys/dev/pci/drm/dma-resv.c
b/sys/dev/pci/drm/dma-resv.c
index
8461b4d
..
d3f7c01
100644
(file)
--- a/
sys/dev/pci/drm/dma-resv.c
+++ b/
sys/dev/pci/drm/dma-resv.c
@@
-588,13
+588,12
@@
int dma_resv_get_fences(struct dma_resv *obj, enum dma_resv_usage usage,
#else
nfences = kmalloc(count * sizeof(void *),
GFP_KERNEL);
- if (nfences != NULL && *fences != NULL)
+ if (nfences != NULL && *fences != NULL)
{
memcpy(nfences, *fences,
(count - 1) * sizeof(void *));
- if (nfences) {
kfree(*fences);
- new_fences = nfences;
}
+ new_fences = nfences;
#endif
if (count && !new_fences) {
kfree(*fences);