Skip to content

Commit adc3d75

Browse files
committed
bd: Fix missing init in MBRBlockDevice
1 parent d7fe4ff commit adc3d75

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

features/filesystem/bd/MBRBlockDevice.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,16 @@ MBRBlockDevice::MBRBlockDevice(BlockDevice *bd, int part)
187187

188188
int MBRBlockDevice::init()
189189
{
190+
int err = _bd->init();
191+
if (err) {
192+
return err;
193+
}
194+
190195
// Allocate smallest buffer necessary to write MBR
191196
uint32_t buffer_size = std::max<uint32_t>(_bd->get_read_size(), sizeof(struct mbr_table));
192197
uint8_t *buffer = new uint8_t[buffer_size];
193198

194-
int err = _bd->read(buffer, 512-buffer_size, buffer_size);
199+
err = _bd->read(buffer, 512-buffer_size, buffer_size);
195200
if (err) {
196201
delete[] buffer;
197202
return err;

0 commit comments

Comments
 (0)