Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional input parameter checks for APIs #408

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

tammyleino
Copy link
Collaborator

Added additional input parameter checks to APIs
Signed-off-by: Tammy Leino tammy_leino@mentor.com

@tammyleino tammyleino force-pushed the openamp_355 branch 2 times, most recently from c1f7e2f to 1381fbb Compare July 27, 2022 19:47
@tammyleino
Copy link
Collaborator Author

Discussion regarding these checks is greatly appreciated - some may be too stringent for all systems.

Copy link
Contributor

@edmooring edmooring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aside from the indentation issue, looks good to go.

lib/rpmsg/rpmsg_virtio.c Show resolved Hide resolved
Copy link
Collaborator

@arnopo arnopo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this robustness improvement?
To align code style would prefer that you test input parameter first. i put an example in comment for the rpmsg_send_offchannel_raw function

lib/include/openamp/rpmsg.h Show resolved Hide resolved

io = remoteproc_get_io_with_va(rproc, rsc_table);
if (rproc && rsc_table)
io = remoteproc_get_io_with_va(rproc, rsc_table);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about?

if (!rproc || !rsc_table || ! rsc_size)
	return -RPROC_EINVAL;

io = remoteproc_get_io_with_va(rproc, rsc_table);
if (!io)
	return -RPROC_EINVAL;

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will change.

@arnopo arnopo linked an issue Aug 17, 2022 that may be closed by this pull request
lib/rpmsg/rpmsg_virtio.c Show resolved Hide resolved
Added additional input parameter checks to APIs
Signed-off-by: Tammy Leino <tammy_leino@mentor.com>
lib/include/openamp/rpmsg.h Show resolved Hide resolved
@arnopo arnopo added this to the Release V2022.10 milestone Sep 26, 2022
@arnopo arnopo merged commit 2016ff1 into OpenAMP:main Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error checking in API routines
3 participants