Skip to contentSkip to conversation

modetest: tab/whitespace cleanup

PATCH New Hyungwon Hwang 1 participant 2 messages Feb 4, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 modetest: tab/whitespace cleanup

This patch removes the trailing tabs and whitespaces.

---
 tests/modetest/modetest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/modetest/modetest.c +2 -2
index 4b9cf2f..6ce8717 100644
@@ -1210,7 +1210,7 @@ static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned
 	evctx.version = DRM_EVENT_CONTEXT_VERSION;
 	evctx.vblank_handler = NULL;
 	evctx.page_flip_handler = page_flip_handler;
-	
+
 	while (1) {
 #if 0
 		struct pollfd pfd[2];
@@ -1521,7 +1521,7 @@ int main(int argc, char **argv)
 			if (parse_connector(&pipe_args[count], optarg) < 0)
 				usage(argv[0]);
 
-			count++;				      
+			count++;
 			break;
 		case 'C':
 			test_cursor = 1;
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 modetest: add null check before destory the buffer object

When setting a plane is turned on without setting a mode, modetest terminates with segmentation fault like below. So this patch adds null check for the variable storing the buffer object in set_mode() which is null in this case.

[ 4759.016695] modetest[619]: unhandled level 2 translation fault (11) at 0x00000000, esr 0x92000006
[ 4759.016959] pgd = ffffffc0b25e1000
[ 4759.017062] [00000000] *pgd=00000000d3492003, *pud=00000000d3492003, *pmd=0000000000000000
[ 4759.017312]
[ 4759.017365] CPU: 0 PID: 619 Comm: modetest Not tainted 3.19.0-rc7-00347-g458583e-dirty #56
[ 4759.024713] Hardware name: XXXXXXX board (DT)
[ 4759.029629] task: ffffffc0b24d5e80 ti: ffffffc0b2a3c000 task.ti: ffffffc0b2a3c000
[ 4759.037071] PC is at 0x404610
[ 4759.039992] LR is at 0x4027f4
[ 4759.042962] pc : [<0000000000404610>] lr : [<00000000004027f4>] pstate: 60000000
[ 4759.050356] sp : 0000007fe65a6f90
[ 4759.053620] x29: 0000007fe65a6f90 x28: 0000000000421060
[ 4759.058912] x27: 000000000041f000 x26: 00000000004226d0
[ 4759.064207] x25: 0000000000421200 x24: 0000000000000006
[ 4759.069502] x23: 000000000040e790 x22: 000000000041f6f0
[ 4759.074797] x21: 0000000000421060 x20: 00000000004216a0
[ 4759.080091] x19: 0000000000000000 x18: 0000000000000000
[ 4759.085386] x17: 000000000041f2c8 x16: 0000000000000000
[ 4495.006841] x15: 0000000000005798 x14: 0000007f93691968
[ 4495.006850] x13: 0000000000005500 x12: 0000000000000005
[ 4495.006855] x11: 16170f12001a1311 x10: 00010004157f1c03
[ 4495.006860] x9 : 000000000000083b x8 : 000000000000003f
[ 4495.006865] x7 : 00000000000018b2 x6 : 00000000004226d0
[ 4495.006870] x5 : 0000000000000000 x4 : 000000000000000a
[ 4495.006875] x3 : 0000000000000000 x2 : 0000000000000001
[ 4495.006880] x1 : 00000000000064b4 x0 : 0000000000000000
[ 4495.006881]

Segmentation fault (core dumped) ./modetest -P 13:200x200+0+0

---
 tests/modetest/modetest.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tests/modetest/modetest.c +2 -1
index 6ce8717..5fcf2a4 100644
@@ -1636,7 +1636,8 @@ int main(int argc, char **argv)
 		if (test_cursor)
 			clear_cursors(&dev);
 
-		bo_destroy(dev.mode.bo);
+		if (dev.mode.bo)
+			bo_destroy(dev.mode.bo);
 	}
 
 	free_resources(dev.resources);
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel