From 93adb32878463cfb92c9bad42f39587b0b267438 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 10 Apr 2024 11:53:22 -0400 Subject: kernel: devfs: Cleanup code and comments Signed-off-by: Ian Moffett --- sys/fs/devfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/fs/devfs.c b/sys/fs/devfs.c index 0438b14..31a135f 100644 --- a/sys/fs/devfs.c +++ b/sys/fs/devfs.c @@ -77,6 +77,7 @@ blkdev_read(struct device *dev, struct device_node *node, struct sio_txn *sio) spinlock_acquire(&node->lock); buf = dynalloc_memalign(buf_size, 0x1000); + if (buf == NULL) { spinlock_release(&node->lock); return -ENOMEM; @@ -157,7 +158,8 @@ devfs_make_devicenode(const char *name, struct device_node **node_out) /* * Only one filename, no paths. * - * TODO: Do something better here... */ + * TODO: Do something better here... + */ for (; *p; ++p, ++name_len) { if (*p == '/') return -EINVAL; -- cgit v1.2.3