Bug 93985 - Completion of error handling
Summary: Completion of error handling
Status: RESOLVED MOVED
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: git
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-03 14:46 UTC by Markus Elfring
Modified: 2018-12-13 22:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Possible changes for the implementation of a single function (2.49 KB, patch)
2018-06-13 15:26 UTC, Markus Elfring
no flags Details | Splinter Review

Description Markus Elfring 2016-02-03 14:46:59 UTC
Would you like to add more error handling for a null pointer which can be returned by a call of the function "malloc" within the implementation of a function like "hostx_get_output_geometry"?
http://cgit.freedesktop.org/xorg/xserver/tree/hw/kdrive/ephyr/hostx.c?id=623ff251dd025929f5bb6174ca86580c5e707261#n293
Comment 1 Adam Jackson 2018-06-12 15:56:26 UTC
Feel free to send a patch.
Comment 2 Markus Elfring 2018-06-13 08:22:36 UTC
(In reply to Adam Jackson from comment #1)

* Are any more places still affected?

* How do you think about to improve static source code analysis also for this software?
Comment 3 Markus Elfring 2018-06-13 15:26:25 UTC
Created attachment 140149 [details] [review]
Possible changes for the implementation of a single function

(In reply to Adam Jackson from comment #1)

Would you find such an update suggestion acceptable?
Comment 4 Adam Jackson 2018-08-20 16:58:49 UTC
(In reply to Markus Elfring from comment #3)
> Created attachment 140149 [details] [review] [review]
> Possible changes for the implementation of a single function
> 
> (In reply to Adam Jackson from comment #1)
> 
> Would you find such an update suggestion acceptable?

Would I accept a patch to cast calls to fprintf to void? Probably not, no, it's a matter of taste but I don't think it adds any value. I don't have any idea why you asked that in response to _this_ bug, which was initially about checking malloc return values.

In any case, Xorg mostly doesn't use bugzilla for patch submission. Please see https://www.x.org/wiki/Development/Documentation/SubmittingPatches/ for details, but be aware that we are likely to move to gitlab for patch management in the very near future.
Comment 5 Markus Elfring 2018-08-21 12:00:17 UTC
(In reply to Adam Jackson from comment #4)
> Would I accept a patch to cast calls to fprintf to void? Probably not, no,

Thanks for your feedback.


> it's a matter of taste but I don't think it adds any value.

I got an other software development opinion for this update suggestion.
I find it useful to indicate that a few return values were intentionally ignored from function calls which generate error messages.


> I don't have any idea why you asked that in response to _this_ bug,
> which was initially about checking malloc return values.

Did you notice that I propose to add a null pointer check in the function “hostx_get_output_geometry”?
Comment 6 GitLab Migration User 2018-12-13 22:35:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/496.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.