|
@@ -1248,7 +1248,15 @@ static struct config_item_type printer_func_type = {
|
|
|
|
|
|
static inline int gprinter_get_minor(void)
|
|
|
{
|
|
|
- return ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL);
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ret = ida_simple_get(&printer_ida, 0, 0, GFP_KERNEL);
|
|
|
+ if (ret >= PRINTER_MINORS) {
|
|
|
+ ida_simple_remove(&printer_ida, ret);
|
|
|
+ ret = -ENODEV;
|
|
|
+ }
|
|
|
+
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static inline void gprinter_put_minor(int minor)
|