Commit Graph

60392 Commits

Author SHA1 Message Date
Adrien Destugues
1602e35c4c PVS V774: use after free
Change-Id: I96267456623389e66f003bef94246c7d58a2c23d
Reviewed-on: https://review.haiku-os.org/c/1626
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues
a216132469 PVS V784: fix size of DR7 register
Even on 64bit CPUs it's a 32bit register.

Change-Id: I9a4de6eec225de19a90d70fae1382b662e530629
Reviewed-on: https://review.haiku-os.org/c/1625
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues
4a113a01d0 PVS V792: use short circuit operators
Avoids calling all the functions, we can stop once one of them is true.

Change-Id: I92437a60d3d52efd5a11547a11b88e3bf232e66b
Reviewed-on: https://review.haiku-os.org/c/1624
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues
72bfb14432 PVS V1028: cast result of operation instead of operands
If an overflow occurs before the cast, we can't fix it. If we cast
first, we can rely on integer promotion to make the result use the
appropriate size.

Change-Id: I7462e28422456c07f179f94d39c10c408d9bec36
Reviewed-on: https://review.haiku-os.org/c/1623
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues
fbe53d9249 PVS V1031: missing includes for memcpy/memset
Change-Id: I106027c0b8a367be1e58598f124e3a6d6541ee32
Reviewed-on: https://review.haiku-os.org/c/1622
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:17:22 +00:00
Adrien Destugues
79d1ca0fa9 PVS V564: use of bitwise operators on booleans
Change-Id: I0a0cd7ddba0abaef27700f1ba05bf99bb8c7a400
Reviewed-on: https://review.haiku-os.org/c/1607
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:11:40 +00:00
Murai Takashi
e081b9cd7e PVS V611: Use delete [] for memory allocated by new [].
Change-Id: I712350ae7f742aaa8e0ea58186265fac4bbac73e
Reviewed-on: https://review.haiku-os.org/c/1627
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-17 22:09:10 +00:00
Adrien Destugues
ff38df48cf PVS V568: strange uses of sizeof
Change-Id: I4c4e0395f579cf3b5ec4db2c30bbe2dc2d866de7
Reviewed-on: https://review.haiku-os.org/c/1608
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:58:27 +00:00
Adrien Destugues
994c85678d PVS V603: useless creation of objects
Change-Id: Ia40d26a9a5c1f4b3383b05f94eb8220fbb36583d
Reviewed-on: https://review.haiku-os.org/c/1615
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
0c5f4fb751 PVS V595: use before null-check
Change-Id: I1e74b376d77686c08778882b6f2c4c67a51b6eb3
Reviewed-on: https://review.haiku-os.org/c/1614
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
6cc8d65e9e PVS V593: missing parentheses
Change-Id: I717b13ebf9b5e2436842cfadab757187529567f2
Reviewed-on: https://review.haiku-os.org/c/1613
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
22817d221a PVS V591: non void functions must return something
Change-Id: I1f4276bc32afab75cf857c143d2bdb4fc3b578b1
Reviewed-on: https://review.haiku-os.org/c/1612
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
d1a703cb22 PVS V579: strange size used for memset
Change-Id: I217e0b4232ec78bbcd651a361fc766b5944d7d7c
Reviewed-on: https://review.haiku-os.org/c/1611
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
4a1d8b1afb PVS V575: strange values passed to well known functions
Change-Id: Id6008d93777f860d0b341bcd012fe6f86c99cf35
Reviewed-on: https://review.haiku-os.org/c/1610
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:57:50 +00:00
Adrien Destugues
bec70b1ec8 Remove useless use of BytePointer
Change-Id: Ic813057de9575b2ec26850d9432746f904927875
Reviewed-on: https://review.haiku-os.org/c/1606
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:48:25 +00:00
Adrien Destugues
12d046d024 PVS V547: always false conditions
Change-Id: I389c081331b1c5ef67bef9ffcac9055573e1ebf5
Reviewed-on: https://review.haiku-os.org/c/1605
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:48:25 +00:00
Adrien Destugues
cbda783eaa PVS V570: variables assigned to themselves
Change-Id: Ia6c4af6a18be28c59dd0e5f0ceab75602c538b10
Reviewed-on: https://review.haiku-os.org/c/1609
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-17 01:46:23 +00:00
Adrien Destugues
fcf7cbe79e PVS V522: null pointer dereferences
Change-Id: Iaa753ef3a93c36031789a85f87e569fc410d3304
Reviewed-on: https://review.haiku-os.org/c/1604
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:44:32 +00:00
Adrien Destugues
439ca67c06 PVS V519: setting the same variable twice
Change-Id: I3967f1c77c89d1aa9d040d8ff7a8593daca8f8b2
Reviewed-on: https://review.haiku-os.org/c/1603
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:38:57 +00:00
Adrien Destugues
ca72c6784d PVS V517: two times the same comparison
Change-Id: I93bfdb8cb09d61f537228c4b0a53ee603240d00d
Reviewed-on: https://review.haiku-os.org/c/1602
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:37:25 +00:00
Adrien Destugues
a6dcaa68a9 PVS V507: pointer to stack leaked to global variable
Change-Id: I56740f4b847c0b99a44e7db830bcccb20bf51cbc
Reviewed-on: https://review.haiku-os.org/c/1601
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:36:48 +00:00
Adrien Destugues
1ec8732c71 PVS V506: using pointer to deallocated stack space
Change-Id: I43f7d0208f7d644d6f4274a9a718773f7a1346a0
Reviewed-on: https://review.haiku-os.org/c/1600
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:35:56 +00:00
Adrien Destugues
11cba1646d PVS V502: missing parentheses around ternary operator
Change-Id: If3179e7b0a583f64e2d690a2f62526bd527e2964
Reviewed-on: https://review.haiku-os.org/c/1599
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:34:12 +00:00
Adrien Destugues
16d463ae1d PVS V501: redundant checks
There are some more in telnetd and agg but I'm not sure if they are
intentional, the code is so ugly there.

Change-Id: I9cc2bf8a919c3b1d6c68f2ded8622730497b0f91
Reviewed-on: https://review.haiku-os.org/c/1598
Reviewed-by: Stephan Aßmus <superstippi@gmx.de>
2019-07-16 20:33:24 +00:00
Humdinger
583c561cb2 Button labels: "Ok" -> "OK"
All caps is our standard.
2019-07-16 20:26:45 +02:00
brjhaiku
ef52a3d48f btrfs: document DirectoryIterator class (no functional change)
Change-Id: Iffbd7112a9a266b65d6dd56dbd040f04e5ab58b2
Reviewed-on: https://review.haiku-os.org/c/1493
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2019-07-16 11:32:13 +00:00
Augustin Cavalier
72ab11b563 userlandfs: libbsd.so is referenced as "libbsd.so".
Fixes the build.
2019-07-16 00:30:21 -04:00
Augustin Cavalier
956664faec usb_audio: Cancel transfers when stopping the stream and do not queue more.
Seems to fix some KDLs caused at lower layers in the stack.
2019-07-16 00:29:02 -04:00
Augustin Cavalier
aefe4850cd USB: Rework the device speed detection code.
This is more in line with how OpenBSD and FreeBSD do this detection;
and should provide at least some support for USB 3.0+ hubs.

Potentially helps with #15001.

Change-Id: I313400b790b52fbca490c9fc8b721bedb97a64f9
2019-07-16 00:29:02 -04:00
Adrien Destugues
85965aba7a PVS-645: invalid/dangerous use of strncat.
Just don't use strncat.

Change-Id: I17efce87cf2ca7f621f98fb0c6679f48f631e98b
Reviewed-on: https://review.haiku-os.org/c/1595
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-16 00:26:41 +00:00
Adrien Destugues
0df9e45c20 Use explicit_bzero where it makes sense
PVS studio new report, warning type V597

Change-Id: Icd85aadf3ffc587806f9a24d224d0a369d4ce0e0
Reviewed-on: https://review.haiku-os.org/c/1594
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-16 00:26:41 +00:00
Humdinger
729709ba87 HaikuDepot: Improved translatability using BStringFormat
The string "(%count% more to download)" is sensitive to
different plural forms in other languages. For example, in
German one could have:
	"1 weiterer Download" and
	"12 weitere Downloads"

Change-Id: I3ab98cca6ae5066f7558e9ce22c97b6c37ec4a9c
Reviewed-on: https://review.haiku-os.org/c/1593
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2019-07-16 00:25:53 +00:00
Autocomitter
c383ef3240 Update translations from Pootle 2019-07-15 01:02:37 +00:00
Augustin Cavalier
d5aa7f00a2 usb_audio: Stop before reallocating buffers and add more error checks.
Also print strerror() for SetGlobalFormat.
2019-07-14 16:31:02 -04:00
Augustin Cavalier
553ff67585 XHCI: Print errors when transfers have non-success completion codes. 2019-07-14 14:37:00 -04:00
Augustin Cavalier
9cd2907d68 XHCI: Trace an error when we receive command events for unknown commands.
This revealed that StopEndpoint commands on QEMU were returning ...
after the semaphore timeout was already hit. Now to figure out
why that is the case...
2019-07-14 14:31:07 -04:00
Augustin Cavalier
60f15f5aa2 XHCI: Turn failure to stop the endpoint into a TRACE_ERROR. 2019-07-14 14:28:24 -04:00
Augustin Cavalier
c8375b0017 XHCI: Tweak priorities a bit more.
Put the EventThread as URGENT_PRIORITY and the downstream FinishThread
as URGENT - 1. Hopefully this will serve as a better hint to the
scheduler as to what we want to occur here.
2019-07-14 14:27:30 -04:00
Kacper Kasper
17c9e98743 TextView: add shortcuts for wordwise delete
Change-Id: Ie67f6255c3f5d9d8ccc6699ed42dd71ae593fa16
Reviewed-on: https://review.haiku-os.org/c/1573
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2019-07-14 14:14:39 +00:00
Augustin Cavalier
b281541f9a usb_audio: Map the buffer area as B_READ_AREA/B_WRITE_AREA.
The calling userland process needs to be able to access it.
2019-07-13 23:43:14 -04:00
Augustin Cavalier
4a6a2fbfda XHCI: Increase priorities of the event and finish threads.
The "event" thread is what is woken up after interrupts, and
the "finish" thread handles the results of the "event" thread,
so prioritize them accordingly. Probably increases responsiveness
of USB input and disk devices visibly on heavily loaded systems.
2019-07-13 23:18:23 -04:00
Augustin Cavalier
f1e99f1667 XHCI: Use PRI to appease GCC2. 2019-07-13 22:59:14 -04:00
Augustin Cavalier
b3c896af1b multi_audio_test: Continue if getting buffers failed.
Don't try and read the buffers anyway, that'll lead to a page fault.
2019-07-13 22:34:54 -04:00
Augustin Cavalier
d5a29ba97c listusb: Do not try to print the port speed.
The USB3 specification changed the meaning of this field, and
it means different things depending on whether a USB 2 or 3
device is attached, so just don't print it.

Fixes listusb saying "Fullspeed" for USB3 devices. The per-device
information already prints what USB version and protocol the
device is operating on, so this was redundant anyway.
2019-07-13 19:37:19 -04:00
Augustin Cavalier
1bccd6b2f7 XHCI: Always trace non-standard port speeds. 2019-07-13 19:37:19 -04:00
Augustin Cavalier
6e2bbbb162 USB: Rename USB_SPEED_SUPER to USB_SPEED_SUPERSPEED.
For consistency's sake with the others.
2019-07-13 19:37:19 -04:00
Augustin Cavalier
b1ea5557ec USB: Remove USB_SPEED_WIRELESS.
It doesn't belong after SUPER, as it's really an extension of USB 2.0
(Linux puts it after HIGHSPEED indeed, as "USB 2.5".) If we eventually
want to support it, we can add it there.
2019-07-13 19:37:19 -04:00
Augustin Cavalier
e06f640862 Installer: Ignore cache directories.
Fixes #15145.
2019-07-13 15:54:47 -04:00
Augustin Cavalier
39681c5c0f BootManager: Lock installation to "Intel" partition types only.
It seems no other OS calls these "Intel" partition types, but instead
MBR partition types. Perhaps we should change this, too?

At any rate, this solves #13260 by blocking installation on GPT
drives altogether.
2019-07-13 15:08:15 -04:00
Augustin Cavalier
14cbb958bd kernel/vfs: Unlock KPath buffers after copying them.
Otherwise we will call UnlockBuffer() when we potentially never
called LockBuffer().

Fixes #15157.
2019-07-13 13:46:19 -04:00